ALLOCATE DESCRIPTOR

Allocates an SQL descriptor area.

allocate_descriptor.png

 

Usage

Embedded, Module.

Description

An SQL descriptor area is allocated. The SQL descriptor area is used to provide information about variables used for input and output between the application and the database. The descriptor-name is identified by a host variable or a literal.

The allocated SQL descriptor area will have as many item descriptor areas as specified by the WITH MAX occurrences clause. If WITH MAX occurrences is omitted, 100 item descriptor areas are allocated.

The SQL descriptor area has the following structure:

COUNT

item descriptor area 1

item descriptor area 2

item descriptor area n

The COUNT field specifies how many item descriptor areas contain data.

See GET DESCRIPTOR for a description of the descriptor fields.

Notes

The maximum length of the descriptor-name is 128 characters.

The scope of a descriptor-name is limited to a single compilation unit and there cannot be more than one descriptor with the same name in a single compilation unit.

Example

maxcol = 256;

exec sql ALLOCATE DESCRIPTOR 'descrOut' WITH MAX :maxcol;

Standard Compliance

Standard

Compliance

Comments

SQL-2016

Features outside core

Feature B031, “Basic dynamic SQL”

Feature B032, “Extended dynamic SQL” support for dynamic descriptor names.