Parameter value descriptors for field procedures
A parameter value descriptor describes the data type and other attributes of a value.
- During field-definition, they describe each constant in the field procedure parameter value list (FPPVL). The set of these optional parameter value descriptors are part of the FPPVL control block.
- During field-encoding and field-decoding, the decoded (column) value and the encoded (field) attributes are described by the column value descriptor (CVD) and the field value descriptor (FVD).
The column value descriptor (CVD) contains a description of a column value. During field-encoding, the CVD describes the value to be encoded. During field-decoding, it describes the decoded value to be supplied by the field procedure. During field-definition, it describes the column as defined in the CREATE TABLE or ALTER TABLE statement.
The field value descriptor (FVD) contains a description of a field value. During field-encoding, the FVD describes the encoded value to be returned from the field procedure. During field-decoding, it describes the value to be decoded. During field-definition a description of the encoded value must put into the FVD.
The following table describes a parameter value descriptor:
Name | Offset | Data Type | Description |
---|---|---|---|
sqlfpSqlType | 0 | 2-byte integer | SQL data type of this parameter. See Appendix D of the SQL Reference for supported values. |
sqlfpByteLength | 2 | unsigned 4-byte integer | Length in bytes of this parameter. For datetime parameters, the length of the string representation of the parameter. |
sqlfpLength | 6 | unsigned 4-byte integer | Length in characters of this parameter. If this is a not a character or graphic type, sqlfpLength and sqlfpByteLength are the same value. |
sqlfpPrecision | 10 | 2-byte integer | Precision if this is a numeric parameter that has precision (decimal, zoned, binary with precision and scale). |
sqlfpScale | 12 | 2-byte integer | Scale if this is a numeric parameter that has scale (decimal, zoned, binary with precision and scale). Scale of 0 if this is a date or time parameter. Scale of 6 if this is a timestamp parameter. |
sqlfpCcsid | 14 | unsigned 2-byte integer | CCSID of this parameter if character or graphic or XML. |
sqlfpAllocatedLength | 16 | unsigned 2-byte integer | The allocated length specified for the column on the CREATE TABLE or ALTER TABLE statement. |
reserved1 | 18 | character(14) | Reserved. |