INCLUDE

Function

This statement includes the data description for the SQLCA or SQLDA.  

Syntax


include.bmp

AS identifier

A host language specific identifier used to explicitly name the pointer variable to the SQLDA structure.  

 

Description

The application programs must be able to determine if an SQL statement has been successfully completed or if it failed. The respective control values are available in the host variable structure called SQLCA. Although, such a structure may be defined and declared explicitly, it is much easier to let Adabas SQL Gateway Embedded SQL generate a definition and a declaration into the host program's source code. Such a generation will occur whenever the SQL statement INCLUDE SQLCA is specified. The position of this statement must conform to the rules of the declaration of host variables and the resulting structure will be represented by the identifier SQLCA. The SQLCA is not updated as a result of an INCLUDE statement.

Note: An explicit identifier can not be specified for an SQLCA structure.

Certain embedded dynamic SQL statements require the use of an SQLDA. Again, such a structure could be defined explicitly, but it is much easier to let Adabas SQL Gateway Embedded SQL generate a definition into the host program's source code. Only an SQLDA structure definition is generated along with a declaration of a pointer to such a structure. The user must actually provide an appropriate structure. The generated pointer will, by default, be identified by SQLDA unless the AS clause is supplied in which case the given identifier is used. The use of such an identifier within an appropriate SQL statement identifies this instance of the SQLDA pointer variable.

Limitations

This statement must be placed outside of a BEGIN DECLARE SECTION. It must also be positioned so that it obeys the rules regarding the declaration of host variables. In accordance with the host language rules governing the declaration of variables and their scope, any number of INCLUDE statements may be specified.

ANSI Specifics

The INCLUDE statement is not part of the Standard.

Adabas SQL Gateway Embedded SQL Specifics

The AS clause is an Adabas SQL Gateway Embedded SQL extension.

 

Examples

 

INCLUDE SQLCA;

INCLUDE SQLDA AS sql_pointer;