How Parameters Are Passed To The External Function - Sybase Adaptive Server IQ 12.4.2 Administration And Performance Manual

Table of Contents

Advertisement

How parameters are passed to the external function

SQL data types are mapped to their C equivalents as follows:
SQL data type
INTEGER
SMALLINT
REAL
CHAR( n )
These are the only SQL data types you can use: using others produces an error.
Procedure parameters that are INOUT or OUT parameters are passed to the
external function by reference. For example, the procedure
CREATE PROCEDURE dll_proc( INOUT xvar REAL )
EXTERNAL NAME 'function_name@library.dll'
has an associated C function parameter declaration of
function_name( float * xvar )
Procedure parameters that are IN parameters are passed to the external function
by value. For example, the procedure
CREATE PROCEDURE dll_proc( IN xvar REAL )
EXTERNAL NAME 'function_name@library.dll'
has an associated external function parameter declaration of
function_name( float xvar )
Character data types are an exception to IN parameters being passed. They are
always passed by reference, whether they are IN, OUT, or INOUT parameters.
For example, the procedure
CREATE PROCEDURE dll_proc ( IN invar CHAR( 128 ) )
EXTERNAL NAME 'function_name@library.dll'
has the following external function parameter declaration
function_name( char * invar )
CHAPTER 6
Using Procedures and Batches
C data type
long (32 bits)
short
float
char *
271

Advertisement

Table of Contents
loading

Table of Contents