CHAPTER 6 Using Procedures and Batches
271
How parameters are passed to the external function
SQL data types are mapped to their C equivalents as follows:
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 )
SQL data type
C data type
INTEGER
long (32 bits)
SMALLINT short
REAL float
CHAR( n )
char *
Summary of Contents for Adaptive Server IQ 12.4.2
Page 1: ...Administration and Performance Guide Adaptive Server IQ 12 4 2 ...
Page 16: ...xvi ...
Page 20: ...Related documents xx ...
Page 40: ...Compatibility with earlier versions 20 ...
Page 118: ...Troubleshooting startup shutdown and connections 98 ...
Page 248: ...Importing data by replication 228 ...
Page 306: ...Integrity rules in the system tables 286 ...
Page 334: ...Cursors in transactions 314 ...
Page 396: ...Users and permissions in the system tables 376 ...
Page 438: ...Determining your data backup and recovery strategy 418 ...
Page 484: ...Network performance 464 ...
Page 500: ...System utilities to monitor CPU use 480 ...
Page 514: ...Characteristics of Open Client and jConnect connections 494 ...
Page 536: ...Index 516 ...