SQL Programming Manual for TAL
Error and Status Processing
HP NonStop SQL Programming Manual for TAL—527887-001
6-13
Getting Information About Dynamic SQL Operations
Getting Information About Dynamic SQL
Operations
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 an
dynamic SQL statement
OUTPUT^NUM Number of output variables in the prepared statement.
Output variables are SELECT columns or LASTSYSKEY
on INSERT RETURNING.
OUTPUT^NAMES^LENGTH Length of buffer required to contain names of output
variables.
NAME^MAP^USE Reserved for system use SQL^STATEMENT^TYPE Type
of statement being prepared. This 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 declarations, include the TALDECS file in
your program with a SOURCE directive:
?SOURCE $ vol. subvol.TALDECS
Table 6-3. SQLSA Fields (page3of3)
Field Name Description