Site icon TechTricky: A Technology Blog on HTML, CSS, JQuery, Webaps and How to\'s

SQLDA Usage_Dynamic SQL

SQLDA USE in Dynamic SQL:

Db2 uses the SQL Descriptor Area(SQLDA) to communicate the dynamic SQL information to the application program.

It contains the various information like type of SQL, length, pointer to the actual data & number of columns etc. which are very useful for better coding.

To get this information into SQLDA after preparing the dynamic Query it should be described.

Ex: 

EXEC SQL
     OPEN CUR-DYN using DESCRIPTOR: WW-SQLDA
END-SQL

 

Below are the different SQLDA fields and sample sqlda structure

Ex:

03 WW-SQLVAR OCCURS 10 TIMES.
   05 WW-SQLTYPE PIC S9(4) COMP.
   05 WW-SQLLEN PIC S9(4) COMP.
   05 WW-SQLDATA POINTER.
   05 WW-SQLIND POINTER.
   05 WW-SQLNAME PIC X(32).

 

To get basic details on Dynamic Queries please refer http://www.techtricky.com/dynamic-sql-in-db2-cobol/

Comment if you have any concerns on this topic.

Exit mobile version
Close Bitnami banner
Bitnami