If you specify the -W option at the time of unloading, you can use the unload data file as the input data file to the database load utility.
In the DAT and extended DAT formats, data is output as character string data. For details about the differences between the DAT and extended DAT formats, see (c) Differences between DAT and extended DAT formats. Except for the cited differences, the DAT and extended DAT formats are identical.
To output data, use the following rules:
For repetition columns, the system outputs data from each element by separating it with separator characters. The row data format depends on what is specified in the array statement in the control information file. Figure 8-13 shows the row data output format when ff is specified in the array statement: Figure 8-14 shows the row data output format when vv is specified in the array statement.
Figure 8-13 Row data output format with ff specified in the array statement
Figure 8-14 Row data output format with vv specified in the array statement
If you specify the sup option during unload operation, the system compresses any trailing spaces in any column that is shorter than the column length specified in the table definitions and then outputs them to the unload data file. The following shows the format depending on the specification of the sup option:
CREATE TABLE T1(C1 INTEGER,C2 CHAR(10),...);
1,"AA",...
1,"AA........",...
CREATE TABLE T1(C1 INTEGER,C2 MCHAR(10),...1,);
1,".",...
1,"..........",...
CREATE TABLE T1(C1 INTEGER,C2 NCHAR(10),...);
1,"AA",...
1,"AA
",...
CREATE TABLE T1(C1 INTEGER,C2 NCHAR(10),...1,);
1,"",...
1,"
",...
CREATE TABLE T1(C1 INTEGER,C2 NCHAR(10),...);
1,"AA",...
1,"AA................",...
CREATE TABLE T1(C1 INTEGER,C2 NCHAR(10),...1,);
1,"..",...
1,"....................",...
The following table describes the differences between the DAT and extended DAT formats:
Item | DAT format | Extended DAT format |
---|---|---|
When the data contains the null character (\0) or linefeed character (\n) | The row containing the corresponding column data value is not output. | The row containing the corresponding column data value is output (\0 and \n are output as is). |
When the enclosing character (") is used as part of the data | The enclosing character used as part of the corresponding column data value is output as is. | Two consecutive enclosing characters are output for an enclosing character that is used as part of the column data value.* Example: " ![]() |
In the binary format, data is output in an internal format based on the database column definition. If this type of file is used as an input to the database load utility, the unloaded table and the data loading target table must have the same column definitions. For a non-FIX table, data cannot be loaded into a FIX table, even if the column definitions are the same.
To output data, use the following rules:
Figure 8-15 Row data output format for non-fix tables
In the fixed-size data format, data is output as fixed-length character string data.
Table 8-3 Output format of each type of column data
Data type of column | Output format | Output length (bytes) | |
---|---|---|---|
Numeric data | INTEGER |
| 11 |
SMALLINT |
| 6 | |
DECIMAL |
![]() | Number of digits + 2 | |
FLOAT |
![]() | 23 | |
SMALLFLT |
| 23 | |
Character string data | CHARACTER |
![]() | Defined length* |
VARCHAR |
![]() | Defined length* | |
Mixed character string data | MCHAR | Same as for CHARACTER. | Defined length* |
MVARCHAR | Same as for VARCHAR. | Defined length* | |
National character data | NCHAR | Same as for CHARACTER. | Defined length ![]() |
NVARCHAR | Same as for VARCHAR. | Defined length ![]() | |
Date data | DATE | Data is output in the format yyyy-mm-dd. (yyyy: year, mm: month, dd: date).
| 10 |
Time data | TIME | Data is output in the format hh:mm:ss (hh: hour, mm: minute, ss: second).
| 8 |
Date interval data | INTERVAL YEAR TO DAY |
| 10 |
Time interval data | INTERVAL HOUR TO SECOND |
| 8 |
Time stamp data | TIMESTAMP | Data is output in the format yyyy-mm-dd![]() ![]()
| 19 Fractions of a second: 0: +0 2: +3 4: +5 6: +7 |
Large object data | BLOB | No data is output. | 0 |
Binary data | BINARY | No data is output. | 0 |
Abstract data type | ![]() | No data is output. | 0 |