SET DESCRIPTOR statement
Use the SET DESCRIPTOR statement to set values in a system-descriptor area (SDA).
Use this statement with .
Syntax
Element | Description | Restrictions | Syntax |
---|---|---|---|
descriptor | String that identifies the SDA to which values are assigned | System-descriptor area (SDA) must be previously allocated | Quoted String |
descriptor_var | Host variable that stores descriptor | Same restrictions as descriptor | Language specific |
item_num | Unsigned integer that specifies ordinal position of an item descriptor in the SDA | 0 < item_num < (number of item descriptors specified when SDA was allocated) | Literal Number |
item_num_var | Host variable that stores item_num | Same restrictions as item_num | Language specific |
total_items | Unsigned integer that specifies how many items the SDA describes | Same restrictions as item_num | Literal Number |
total_items_var | Host variable that stores total_items | Same restrictions as total_items | Language specific |
Usage
The SET DESCRIPTOR statement can be used after you have described SELECT, EXECUTE FUNCTION, EXECUTE PROCEDURE, ALLOCATE DESCRIPTOR, or INSERT statements with the DESCRIBE ... USING SQL DESCRIPTOR statement.
SET DESCRIPTOR
can assign values to a system-descriptor area in these cases:
- To set the COUNT field of a system-descriptor area to match the number of items for which you are providing descriptions in the system-descriptor area
- To set the item descriptor for each value for which you are providing descriptions in the system-descriptor area
- To modify the contents of an item-descriptor field
If an error occurs during the assignment to any identified
system-descriptor fields, the contents of all identified fields are
set to 0
or NULL, depending on the data type of the
variable.