SQL/MP Programming Manual for C
Dynamic SQL Operations
HP NonStop SQL/MP Programming Manual for C—429847-008
10-28
Perform the Database Request and Display the
Values
3. End the TMF transaction:
EXEC SQL COMMIT WORK;
4. Call the free function to deallocate the memory for the SQLDA structures and
names buffers and for the values.
After the input statement is dynamically compiled with the PREPARE statement, the
SQLSA structure contains this information:
The input_num field is the number of input parameters in the statement. Use this
information to determine how many parameter values to request from the user.
The input_names_len field is the length of the buffer required to contain the
names of the input parameters.
The output_num field is the number of output variables in the statement. Use this
information to determine how many column values to report.
The output_names_len field is the length of the buffer required to contain the
names of the output variables.
The sql_statement_type field is the type of statement that was prepared,
which can have these values:
A program can use these values to allocate memory for the number of input
parameters and output variables, and for the input and output names buffer length.
_SQL_STATEMENT_SELECT 1
_SQL_STATEMENT_INSERT 2
_SQL_STATEMENT_UPDATE 3
_SQL_STATEMENT_DELETE 4
_SQL_STATEMENT_DDL 5
_SQL_STATEMENT_CONTROL 6
_SQL_STATEMENT_DCL 7
_SQL_STATEMENT_GET 8