Manage an sqlda structure

Your program can manipulate an sqlda structure with the SQL statements that the following tables summarize.
Table 1. SQL statements that can be used to manipulate an sqlda structure
SQL Statement Purpose See
DESCRIBE...INTO Allocates an sqlda structure and initializes this structure with information about column-list columns Allocate memory for the sqlda structure

Initialize the sqlda structure

Table 2. SQL statements that can be used to manipulate an sqlda structure: SELECT and EXECUTE FUNCTION statements that use cursors
SQL Statement Purpose See
OPEN...USING DESCRIPTOR

FETCH...USING DESCRIPTOR

Takes any input parameters from the specified sqlda structure

Puts the contents of the row into the sqlda structure

Specify input parameter values

Put column values into an sqlda structure

Table 3. SQL statements that can be used to manipulate an sqlda structure: SELECT and EXECUTE FUNCTION statements that return only one row
SQL Statement Purpose See
EXECUTE...INTO DESCRIPTOR Puts the contents of the singleton row into the sqlda structure Put column values into an sqlda structure
Table 4. SQL statements that can be used to manipulate an sqlda structure: non-SELECT statements
SQL Statement Purpose See
EXECUTE...USING DESCRIPTOR Takes any input parameters from the specified sqlda structure Specify input parameter values
Table 5. SQL statements that can be used to manipulate an sqlda structure: an INSERT statement that uses an insert cursor
SQL Statement Purpose See
PUT...USING DESCRIPTOR Puts a row into the insert buffer after it obtains the column values from the specified sqlda structure Handling an unknown column list
In addition, your program can manage an sqlda structure in the following ways:
  • Declare a variable pointer to an sqlda structure.
  • Assign values to the sqlda fields to provide the database server with missing column information.
  • Obtain information from the sqlda fields to access column information that is received from the database server.
  • Free the memory allocated to the sqlda structure when your program is finished with it.