Scalable Database Server, HiRDB Version 8 Command Reference
In the DAT format, both input data and the input parameters for a constructor function are specified as character string data.
Each column data item must be separated by a separator character.
Table 5-12 shows the specification format of column data and parameters for a construction function by the data type (DAT format).
Table 5-12 Specification format of column data and parameters by data type (DAT format)
| Data type | Specification format of column data and parameter | ||
|---|---|---|---|
| General data | Null value or default value1 | ||
| Numeric data | INTEGER |
Decimal point (Example: -1.56...0...1.56) Floating point (Example: -2.4e+9...0e0...2.4e+9) |
* or not specified |
| SMALLINT | |||
| DECIMAL | |||
| FLOAT | |||
| SMALLFLT | |||
| Character string data | CHARACTER | Specify as characters or a character string enclosed in double quotation marks ("). (Example: abcdef, ABCDEF) (Example: "abcd", "ABCD") |
Not specified |
| VARCHAR | |||
| National character string data | NCHAR | ||
| NVARCHAR | |||
| Mixed character string data | MCHAR | ||
| MVARCHAR | |||
| Date data | DATE | Specify in the numeric format yyyy-mm-dd. yyyy: Year. mm: Month. dd: Day. (Example: January 1, 1995 |
* or not specified |
| Date interval data | INTERVAL YEAR TO DAY | Specify in the numeric format [-]yyyymmdd. For a negative value, add a minus sign (-). (Example: 1111 years, one month, and one day |
|
| Time data | TIME | Specified in the numeric format hh:mm:ss. hh: Hour. mm: Minute. ss: Second. (Example: 12:01:01 |
|
| Time interval data | INTERVAL HOUR TO SECOND | Specified in the numeric format [-]hhmmss. For a negative value, add a minus sign (-). (Example: 1 hour, 1 minute, and 1 second |
|
| Time stamp data | TIMESTAMP | Specified in the numeric format YYYY-MM-DD hh:mm:ss[.nnnnnn]. For the fraction part of the second, specify a value with a length of 0 to 6 digits. If the fraction part is less than the defined length, the system assumes 0; if it is longer than the defined length, the system discards the excess portion. If the fraction part consists of more than 6 digits, an error (KFPL31002-E) results.2 |
|
| Binary data | BINARY | Specifies the binary data or binary data enclosed in the enclosing characters. (Examples: abc 123 or "abc 123") |
Not specified |
| Large object data | BLOB | -k f specified: Specify the name of the LOB input file. (Example: lobfile01) -k c specified: Specify a character string with a length of 1-1,023 bytes without any separator characters. This character string is ignored when LOB data is loaded. (Example: @) |
|
| Defined digits | Length of the fraction part of the second in input data | |||||||
|---|---|---|---|---|---|---|---|---|
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 or more | |
| 0 | Stored as is.1 | Discards excess digits. | Error (KFPL31002-E) | |||||
| 2 | Adds zeros up to the defined length.2 | Stored as is.1 | Discards excess digits. | |||||
| 4 | Adds zeros up to the defined length.2 | Stored as is.1 | Discards excess digits. | |||||
| 6 | Adds zeros up to the defined length.2 | Stored as is.1 | ||||||
Table 5-13 Handling of character string data and enclosing characters
| Character string data in input data file | Data stored in table | |
|---|---|---|
| DAT format | Extended DAT format | |
| ...,ABCD,... | ABCD | ABCD |
| ...,AB"CD,... | AB"CD | Input data error |
| ...,AB""CD,... | AB""CD | AB"CD |
| ...,"ABCD",... | ABCD | ABCD |
| ...,"AB"CD",... | AB"CD | Input data error |
| ...,"AB""CD",... | AB""CD | AB"CD |
| ...,""ABCD"",... | "ABCD" | Input data error |
| ...,"""ABCD""",... | ""ABCD"" | "ABCD" |
| ...,,... | Null value or default value* | Null value or default value* |
| ...,"",... | Null value or default value* | Null value or default value* |
| ...,"""",... | "" | " |
| ...,"AB,CD",... | AB,CD | AB,CD |
| ...,AB\0CD,... | Input data error | Input data error |
| ...,AB\nCD,... | Input data error | Input data error |
| ...,"AB\0CD",... | Input data error | AB\0CD |
| ...,"AB\nCD",... | Input data error | AB\nCD |
Table 5-14 Format of character string data converted to numeric data
| Numeric value expressed as character string data | Notation | |
|---|---|---|
| Specification format | Example (specification |
|
| Integer | A natural number is a string of numeric characters 0-9. |
+10 -009 |
| Decimal number | A fraction is an unsigned integer. Either the integer or the fraction must be specified. |
-0.8 1.0 +1. |
| Floating point number | Mantissa is expressed as an integer or decimal number. E may be specified for e. Exponent is expressed as a one-digit or two-digit integer. |
.3e 2.4e-02 67e-5 |
Table 5-15 Handling of storage data when the length of input data doesn't match the data length in table
| Data length in table (m) | Data length of input data (n) | |
|---|---|---|
| Fixed-length character string data | Variable-length character string data or binary data | |
| m = n | Input data is stored as is. | |
| m < n | When the lengover operand is omitted in the option statement, the portion of the input data following (m + 1) is discarded.* When the lengover operand is specified in the option statement, the input data is not stored because it is regarded as an input data error. |
|
| m > n | Input data is padded with spaces after (n + 1). | Input data is stored as is. |
* If cutdtmsg=on is specified in the option statement and data truncation occurs, the system outputs warning messages to the error information file.
Table 5-16 Data to be stored and how to specify the null value when enclose=" is specified in the extdat statement
| Data type | Input data | Data to be stored in table | How to specify null value or default value* | |
|---|---|---|---|---|
| Numeric data | INTEGER | "1234" | 1234 | *, "", "*", or not specified |
| SMALLINT | "1234" | 1234 | ||
| DECIMAL(6,1) | "000001" | 00001.0 | ||
| FLOAT | "2.225075e-308" | +2.225075000000000E-308 | ||
| SMALLFLT | "1.175495e-38" | +1.175495051471520E-38 | ||
| Character string data | CHAR | "ABCDE" | ABCDE | "" or not specified |
| VARCHAR | "ABCDE" | ABCDE | ||
| National character string data | NCHAR | " |
||
| NVARCHAR | " |
|||
| Mixed character string data | MCHAR | "ABCDE" | ABCDE | |
| MVARCHAR | "ABCDE" | ABCDE | ||
| Date data | DATE | "2000-05-31" | 2000-05-31 | *, "", "*", or not specified |
| Date interval data | INTERVAL YEAR TO DAY | "+00000000." | 00000000 | |
| Time data | TIME | "09:00:00" | 09:00:00 | |
| Time interval data | INTERVAL HOUR TO SECOND | "+000000." | 000000 | |
| Time stamp data | TIMESTAMP(6) | "2002-08-08 |
2002-08-08 20:25:43.390000 | |
| Binary data | BINARY | "ABCDE" | ABCDE | "" or not specified |
| Large object data | BLOB | "LOB-input-file-name" | Contents of the LOB input file | |
Table 5-17 Examples of space deletion when enclose=" is specified in the extdat statement
| Data type | Input data | Data to be stored in table | |
|---|---|---|---|
| Numeric data | INTEGER | " |
1234 |
| SMALLINT | " |
Null value | |
| DECIMAL(6,1) | " |
00001.0 | |
| FLOAT | " |
+2.225075000000000E-308 | |
| SMALLFLT | "1.175495e-38 |
+1.175495051471520E-38 | |
| Date data | DATE | " |
2000-05-31 |
| Date interval data | INTERVAL YEAR TO DAY | "+ |
00000000 |
| Time data | TIME | " |
09:00:00 |
| Time interval data | INTERVAL HOUR TO SECOND | " |
000000 |
| Time stamp data | TIMESTAMP | " |
2002-08-08 20:25:43.39 |
Figure 5-11 shows a specification example of DAT-format data.
Figure 5-11 Specification example of DAT-format data
All Rights Reserved. Copyright (C) 2007, Hitachi, Ltd.