Previous Topic: Sample JCLNext Topic: Determining Number of SQLVAR Entries to Use


SQL Descriptor Area (SQLDA)

The SQL Descriptor Area (SQLDA) is used in the DESCRIBE statement. It can also be used in the EXECUTE, FETCH, OPEN, and PREPARE statements. Activities involving the SQLDA include building the SQLDA, updating the SQLDA, and using the SQLDA.

You build an SQLDA by coding an SQLDA and using a DESCRIBE or PREPARE statement to fill it. (When you use a PREPARE statement to fill an SQLDA, you must use the PREPARE's optional INTO clause.) For an example COBOL SQLDA and more information about the DESCRIBE and PREPARE statements, see DESCRIBE and PREPARE.

After you have built an SQLDA in a DESCRIBE statement, you can update the SQLDATA entry (in the SQLDA) with a host variable address or update the SQLIND entry with an indicator variable address. You must update the SQLDATA entry with a host variable address before using the SQLDA in a FETCH statement.

You can retrieve values for parameter markers from the SQLDA by using OPEN or EXECUTE statements. A parameter marker is a question mark (?) that is used in place of a host variable in dynamic SQL statements. Rules for parameter markers can be found in PREPARE.

FETCH cursor-name can use the SQLDA to store the output of a select-statement, if that select-statement was built by the DECLARE CURSOR statement in which the corresponding cursor-name was defined.