Declaring an XSQLDA
Go Up to DSQL Requirements (Embedded SQL Guide)
The extended SQL descriptor area (XSQLDA
) is used as an intermediate staging area for information passed between an application and the InterBase engine. The XSQLDA
is used for either of the following tasks:
- Pass input parameters from a host-language program to SQL.
- Pass output, from a
SELECT
statement or stored procedure, from SQL to the host-language program.
A single XSQLDA
can be used for only one of these tasks at a time. Many applications declare two XSQLDAs
, one for input, and another for output.
The XSQLDA
structure is defined in the InterBase header file, ibase.h
, that is automatically included in programs when they are preprocessed with gpre
.
DSQL applications written using versions of InterBase prior to 3.3 use an older SQL descriptor area, the
SQLDA
. The SQLDA
and the gpre -sqlda
switch are no longer supported. Older applications should be modified to use the XSQLDA
.To create an XSQLDA
for a program, a host-language data type of the appropriate type must be set up in a section declaration. For example, the following statement creates two XSQLDA
structures, inxsqlda
, and outxsqlda
:
. . . EXEC SQL BEGIN DECLARE SECTION; XSQLDA inxsqlda; XSQLDA outxsqlda; . . . EXEC SQL END DECLARE SECTION; . . .
When an application containing XSQLDA
declarations is preprocessed, gpre
automatically includes the header file, ibase.h
, which defines the XSQLDA
as a host-language data type. For a complete discussion of the structure of the XSQLDA
, see Using Dynamic SQL.