Defining SQL descriptor areas

If your program includes certain SQL statements, you must define at least one SQL descriptor area (SQLDA). Depending on the context in which it is used, the SQLDA stores information about prepared SQL statements or host variables. This information can then be read by either the application program or DB2®.

About this task

If your program includes any of the following statements, you must include an SQLDA in your program:

  • CALL … USING DESCRIPTOR descriptor-name
  • DESCRIBE statement-name INTO descriptor-name
  • DESCRIBE CURSOR host-variable INTO descriptor-name
  • DESCRIBE INPUT statement-name INTO descriptor-name
  • DESCRIBE PROCEDURE host-variable INTO descriptor-name
  • DESCRIBE TABLE host-variable INTO descriptor-name
  • EXECUTE … USING DESCRIPTOR descriptor-name
  • FETCH … INTO DESCRIPTOR descriptor-name
  • OPEN … USING DESCRIPTOR descriptor-name
  • PREPARE … INTO descriptor-name

Unlike the SQLCA, a program can have more than one SQLDA, and an SQLDA can have any valid name.

Procedure

To define SQL descriptor areas:

Take the actions that are appropriate for the programming language that you use.