Once you have created a descriptor area, you can assign values to this area in a number of ways:
Data type descriptions:
You can use DESCRIBE to place the description of the SQL data types of the placeholders or derived values of a prepared statement or cursor description in the descriptor area.Values:
You can use EXECUTE ... INTO or FETCH ... INTO to place queried values in the descriptor area.Data type descriptions and values:
You can use SET DESCRIPTOR to set the items in the descriptor area. The values assigned to the item descriptor fields are described in the section “SET DESCRIPTOR - Update SQL descriptor area”.
The fields NAME, UNNAMED and NULLABLE are only set for DESCRIBE.
The fields TYPE, DATETIME_INTERVAL_CODE, LENGTH, PRECISION, SCALE, REPETITIONS can be set with SET DESCRIPTOR and DESCRIBE.
The fields INDICATOR and DATA can be set with SET DESCRIPTOR or with EXECUTE INTO and FETCH INTO if an SQL descriptor area is used.
If a value is transferred from a host variable to a descriptor area field, the SQL data type of the host variable must satisfy the conditions described for SET DESCRIPTOR, "SET DESCRIPTOR - Update SQL descriptor area", and in the section “Transferring values between host variables and a descriptor area”.