Previous Topic Next topic Print topic


SQL Descriptor Area (SQLDA)

COBOL programs that include dynamic SQL must have an SQL Descriptor Area (SQLDA) defined. This definition is usually accomplished by including the SQLDA copybook provided with Enterprise Developer.

Important: Enterprise Developer does not default to using the XDB SQLDA. To ensure that Enterprise Developer uses the XDB SQLDA, you must add the path to the provided XDB copybooks to the COBOL Copybook Paths in your project properties. By default, this is %ProgramFiles(x86)%\Micro Focus\Enterprise Developer\cpylib\xdb . To do this:
  1. On your project properties Copybook tab, click in the right pane to get an entry field and browse button.
  2. Type the full path to the XDB copybook files, or click the browse button to select a directory.
  3. If your added path does not appear at the top of the list, click Line Up Line Up icon until it reaches the top position.

The default SQLDA copybook used by the SQL Option preprocessor is not mainframe DB2 compatible. Instead it is designed for easy compatibility if you are upgrading from older version of XDB or SQL Option software.

A mainframe compatible SQLDA is provided in the %ProgramFiles(x86)%\Micro Focus\Enterprise Developer\cpylib\xdb directory with filename of sqlda.cpy. If you want to use that copybook instead, just rename it. You then need to compile all programs that use this copybook or SQLDA's defined using the mainframe SQLDA structure with the SQL preprocessor directive SQLDA-VER=1 or the program will not map data properly and probably trap.

The SQLDA holds information about dynamic SQL queries, and is required for allocating the proper amount of space for the query.

For more information about dynamic SQL and the SQLDA, see the topic Using Dynamic SQL in COBOL. For a complete description of the SQLDA structure, see the SQL Reference. Refer to your preprocessor documentation on the use of pointer variables and for additional information on dynamic SQL in COBOL programs.

Previous Topic Next topic Print topic