5. Embedded OpenSQL : Data Handlers for Large Objects : Large Objects in Dynamic SQL : Data Handlers in Dynamic SQL
 
Share this page                  
Data Handlers in Dynamic SQL
To specify a data handler routine to be called by a dynamic query that reads or writes a large object column, prepare the SQLDA fields for the large object column as follows:
Set the sqltype field to IISQL_HDLR_TYPE. This value is defined when using the include sqlda statement to define an SQLDA structure in your program.
Declare a sqlhdlr structure in your program. For details, see the Embedded SQL Companion Guide. Load the sqlhdlr field of this structure with a pointer to your data handler routine. If a variable is to be passed to the data handler, load the sqlarg field with a pointer to the variable. If no argument is to be passed, set the sqlarg field to 0.
If the value of the large object column is null (sqlind field of the SQLDA set to -1) the data handler is not invoked.