Loading variable-length data
You can load variable-length data by using the LOAD utility.
Procedure
To load variable-length data:
Include a 2-byte binary length field before each field
of variable-length data. The value in that field depends on the data
type of the column into which you load the data. Use:
- The number of single-byte characters if the data type is VARCHAR
- The number of double-byte characters if the data type is VARGRAPHIC
For example, assume that you have a variable-length column that contains X'42C142C142C2', which might be interpreted as either six single-byte characters or three double-byte characters. With the two-byte length field, use:
- X'0006'X'42C142C142C2' to signify six single-byte characters in a VARCHAR column
- X'0003'X'42C142C142C2' to signify three double-byte characters in a VARGRAPHIC column