SQL Programming Manual for Pascal
Error and Status Processing
HP NonStop SQL Programming Manual for Pascal—528614-001
6-13
Getting Information About Dynamic SQL Operations
Getting Information About Dynamic SQL
Operations
For detailed information about dynamic SQL operations, see Section 7, Using Dynamic
SQL.
NonStop SQL uses the SQL descriptor area (SQLDA) to provide information about
input parameters and output variables in dynamic SQL statements. The SQLDA also
provides pointers to data buffers that your program uses to set values for input
parameters and to receive values for output variables. The names buffer, which you
can generate with the SQLDA or declare separately, receives the names of the input
parameters or output variables.
You can use the SQLDA data structure in:
•
A DESCRIBE INPUT statement to get information about input parameters
•
A DESCRIBE statement to get information about output columns
•
The USING DESCRIPTOR clause of a FETCH statement to fill a cursor with rows
from an SQL table
•
The USING DESCRIPTOR clause of an EXECUTE statement to execute a
dynamic SQL statement
output_names_len Length of buffer required to contain names of output variables.
name_map_len Reserved for system use.
sql_statement_type Type of statement being prepared. The following literal
declarations represent the values for this field:
SQL_STATEMENT_SELECT Cursor SELECT
SQL_STATEMENT_INSERT Insert
SQL_STATEMENT_UPDATE Update
SQL_STATEMENT_DELETE Delete
SQL_STATEMENT_DDL DDL statement
SQL_STATEMENT_CONTROL Run-time CONTROL
TABLE
SQL_STATEMENT_DCL LOCK, UNLOCK, or FREE
RESOURCES
To use these literal declarations, include the PEXTDECS file in
your program with a SOURCE directive:
?SOURCE $VOL.SUBVOL.PEXTDECS
(SQL_STATEMENT)
Table 6-3. SQLSA Fields (page3of3)
Field Description