5.5.2 Binary format

In the binary format, the input data is specified in the format stored in the database.

Organization of this subsection
(1) Specification format
(2) Rules
(3) Example
(4) Coding LOB data and LOB parameters when v or d is specified in the -k option

(1) Specification format

(a) Specification format of column data

Table 5-18 shows the specification format of column data and parameters by the data type (binary format).

Table 5-18 Specification format of column data and parameters (binary format)

Data and parameter typesColumn data specification format
Numeric dataINTEGER, SMALLINT[Figure]
DECIMAL(m, n)
1 [Figure] m[Figure] 29
0 [Figure] n[Figure] 29
m[Figure] n
[Figure]
FLOAT, SMALLFLT[Figure]
Character string, national character string, and mixed character string dataCHARACTER(n), VARCHAR(n), MCHAR(n), MVARCHAR(n)[Figure]
NCHAR(n), NVARCHAR(n)[Figure]
Date dataDATE[Figure]
Date interval dataINTERVAL YEAR TO DAY[Figure]
Time dataTIME[Figure]
Time interval dataINTERVAL HOUR TO SECOND[Figure]
Time stamp dataTIMESTAMP(p)[Figure]
BINARY data, BINARY attribute dataBINARY[Figure]
LOB data, LOB attribute dataBLOB[Figure]

* Only when the -z option is specified, does the system set the actual data length to 0 and treats the part without the actual data as 0-length data.

(b) Input parameter specification format

The following describes the input parameter specification format:

(2) Rules

(3) Example

Figure 5-13 shows a specification example of binary-format data.

Figure 5-13 Specification example of binary-format data

[Figure]

Notes
  1. The upper row of the input data indicates the data, and the lower row indicates the values to be stored.
  2. The data types are, from left to right, NCHAR(5), INTEGER, SMALLFLT, and VARCHAR.
  3. National character data is in shift JIS or EUC Chinese Kanji codes.

(4) Coding LOB data and LOB parameters when v or d is specified in the -k option

(a) -k v

When specifying v in the -k option, directly code the input file name for LOB data and the data for the LOB parameter in the data input file.

When compared with specifying f in the -k option, this method can reduce input/output time for the LOB input file.

Rules
  1. Specify the LOB data and the LOB parameter in a format in which a given column in row data has a 4-byte length section, such that the data section is coded following the row data. Specify these items in the column order of the row data.
  2. If the LOB data or the LOB parameter is the null value, specify a value of -1 in the length section. The system ignores any null comparison values produced by a null value/function information file or a function information file. Do not specify the data section.
  3. If the LOB data or the LOB parameter has 0 bytes, specify a value of 0 in the length section without specifying a data section.
Example
(b) -k d

When specifying d in the -k option, specify the data itself, not the name of the LOB data storage file, in the input data file.

Rules

  1. Specify the LOB data and the LOB parameter data in a format in which a given column in row data has a 4-byte length section, such that the data section is coded following the row data.
  2. Specify the input data file in the following order:

    [row data]  [LOB parameter data]  [LOB data]
     1                2                 3

    Explanation:
    1. Specify the length section in the row data in the order of column definition.
    2. Specify the LOB parameter data immediately after the row data in the order of column definition.
    3. Specify the LOB data immediately following item B in the order of column definition.
  3. If the LOB data or the LOB parameter data is the null value, specify a value of -1 in the 4-byte length section. The system ignores any null comparison values produced by a null value/function information file or a function information file. Do not specify the data section. There is no data section.
  4. If the LOB data or the LOB parameter has 0 bytes, specify a value of 0 in the length section without specifying a data section.
Example