External function prototypes

This section describes the API that you use for functions written in C or C++.

The API is defined by a header file named extfnapi.h, in the SDK\Include subdirectory of your SQL Anywhere installation directory. This header file handles the platform-dependent features of external function prototypes.

Function prototypes

The name of the function must match that referenced in the CREATE PROCEDURE or CREATE FUNCTION statement. Suppose the following CREATE FUNCTION statement had been executed.

CREATE FUNCTION cover-name ( parameter-list )
  RETURNS data-type
  EXTERNAL NAME 'function-name@library.dll'
  LANGUAGE C_ESQL32;

The C/C++ function declaration must be as follows:

void function-name( an_extfn_api *api, void *argument-handle )

The function must return void, and must take as arguments a pointer to a structure used to call a set of callback functions and a handle to the arguments provided by the SQL procedure.


extfn_use_new_api method
extfn_cancel method
an_extfn_api structure
an_extfn_value structure
an_extfn_result_set_info structure
an_extfn_result_set_column_info structure
an_extfn_result_set_column_data structure