


The usage of a descriptor allows different SQL statements and tables to be used for every execution of the ADABAS application without having to change the source code. This means, the SQL statement is only generated at the application's runtime. A descriptor must be used when the structure of the result table generated by a SELECT statement is not known and has to be ascertained.
Host variables are not appropriate for the implementation of such an ADABAS application because neither number nor types of the parameters of the SQL statement are known at precompilation time. It is therefore impossible to associate parameters with host variables in the USING part of the EXECUTE statement. The necessary relations between the parameters of an SQL statement and the program variables are established instead by means of the SQL Descriptor Area (SQLDA), also referred to simply as descriptor.
The SQLDA is generated by the precompiler when a DESCRIBE statement occurs in the ADABAS application. The programmer can declare his own descriptors. These must be given names other than SQLDA and must not be defined in the DECLARE SECTION. The structure of the SQLDA is provided in include files (see the ADABAS user manuals). It contains all the information which is needed for associating a program variable, which must be compatible with the ADABAS column, with a parameter of an SQL statement. Such parameters are designated as input parameters when they transfer values to an SQL statement or to the ADABAS database, and they are designated as output parameters when they transfer values from the ADABAS database to the application.


