Value descriptor for field procedures

A value descriptor describes the data type and other attributes of a value.

Begin program-specific programming interface information.
Value descriptors are used with field procedures in these ways:
  • During field-definition, they describe each constant in the field procedure parameter value list (FPPVL). The set of these value descriptors is part of the FPPVL control block.
  • During field-encoding and field-decoding, the decoded (column) value and the encoded (field) value 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 and, if appropriate, the value itself. 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 and, if appropriate, the value itself. During field-encoding, the FVD describes the encoded value to be supplied by the field procedure. During field-decoding, it describes the value to be decoded. Field-definition must put into the FVD a description of the encoded value.

Value descriptors have the following formats:

Table 1. Format of value descriptors
Name Hex offset Data type Description
FPVDTYPE 0 Signed 2-byte integer Data type of the value:
Code
Means
0
INTEGER
4
SMALLINT
8
FLOAT
12
DECIMAL
16
CHAR
20
VARCHAR
24
GRAPHIC
28
VARGRAPHIC
FPVDVLEN 2 Signed 2-byte integer
  • For a varying-length string value, its maximum length
  • For a decimal number value, its precision (byte 1) and scale (byte 2)
  • For any other value, its length
FPVDVALE 4 None The value. The value is in external format, not Db2 internal format. If the value is a varying-length string, the first halfword is the value's actual length in bytes. This field is not present in a CVD, or in an FVD used as input to the field-definition operation. An empty varying-length string has a length of zero with no data following.
End program-specific programming interface information.