Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Usage » Using Procedures, Triggers, and Batches » Calling external libraries from procedures

External function prototypes Next Page

Passing parameters to external functions


Data types

The following SQL data types can be passed to an external library:

SQL data type C type
CHAR Character data, with a specified length
VARCHAR Character data, with a specified length
LONG VARCHAR Character data, with a specified length
BINARY Binary data, with a specified length
LONG BINARY Character data, with a specified length
TINYINT 1-byte integer
[ UNSIGNED ] SMALLINT [ Unsigned ] 2-byte integer
[ UNSIGNED ] INT [ Unsigned ] 4-byte integer
[ UNSIGNED ] BIGINT [ Unsigned ] 8-byte integer
VARBINARY Binary data, with a specified length
REAL Single precision floating point number
DOUBLE Double precision floating point number

You cannot use date or time data types, and you cannot use exact numeric data types.

To provide values for INOUT or OUT parameters, use the set_value API function. To read IN and INOUT parameters, use the get_value API function.

Passing NULL

You can pass NULL as a valid value for all arguments. Functions in external libraries can supply NULL as a return value for any data type.

Return values

To set a return value for an external function, call the set_value function with an arg_num parameter of 0. If set_value is not called with arg_num=0, the function result is NULL.