Hitachi

Hitachi Advanced Database Command Reference


17.5.3 Specification format of field data (CSV format)

The following table describes the specification format of field data.

Table 17‒14: Specification format of field data

No.

Data type

Specification format of field data

Format

Specification example

Notes

Empty string specification example#1

1

Numeric data

INTEGER

[{+|-}]a...a

+ and -: Signs

a...a: Numeric value (a is 0 to 9)

  • 100

  • -123

  • 000

  • 0657

  • A maximum of 20 characters combining signs and numeric values can be specified.

  • Regardless of the format or the restriction on the number of characters, one or more single-byte spaces or tab characters can be inserted before or after each character. #2

  • ...,*,...

  • ...,"*",...

  • ...,,...

  • ...,"",...

  • ...,"""",...

If none is specified in the -k option, examples that use the enclosing character cannot be specified.

2

SMALLINT

[{+|-}]a...a

+ and -: Signs

a...a: Numeric value (a is 0 to 9)

  • 100

  • -0123

  • 0

  • +0657

  • A maximum of 11 characters combining signs and numeric values can be specified.

  • Regardless of the format or the restriction on the number of characters, one or more single-byte spaces or tab characters can be inserted before or after each character. #2

Same as No. 1

3

DECIMAL

[{+|-}]

{a...a[.[b...b]]|.b...b}

+ and -: Signs

a...a: Integer part (a is 0 to 9)

b...b: Decimal part (b is 0 to 9)#3

  • 100

  • -123.00

  • Δ.00

  • 012.

  • -1.56

  • +.560

  • A maximum of 38 characters combining the integer part and the decimal part can be specified (if the precision and scaling are the same in the column at the storage destination, a maximum of 39 characters can be specified only when the integer part (0) is not omitted).

  • Regardless of the format or the restriction on the number of characters, one or more single-byte spaces or tab characters can be inserted before or after each character. #2

Same as No. 1

4

DOUBLE PRECISION

[{+|-}]

{a...a[.[b...b]]|.b...b}[{E|e}[[{+|-}]c...c]]

+ and -: Signs

a...a: Integer part of the mantissa (a is 0 to 9)

b...b: Decimal part of the mantissa (b is 0 to 9)

c...c: Exponent part (c is 0 to 9)#4

E and e: Floating point numeric literal (literal identifying the exponent in a floating-point number)

  • 100

  • -Δ123

  • 0.Δ

  • -1.5600

  • .56

  • -02.4e+9

  • 000e

  • 2.4E+009

  • A maximum of 509 characters can be specified.#5

  • Regardless of the format or the restriction on the number of characters, one or more single-byte spaces or tab characters can be inserted before or after each character. #2

Same as No. 1

5

Character string data

CHARACTER

a...a

a...a: Data containing at least one character

  • abcdef[Figure]

  • ABCDEF

  • Δ

  • A number of characters up to the definition length of the column at the storage definition can be specified.

  • Except for the beginning of data, single-byte spaces that continue to the end of data can be omitted.#6

  • ...,,...

  • ...,"",...

Single-byte spaces and tab characters cannot be inserted.

If none is specified in the -k option, examples that use the enclosing character cannot be specified.

6

VARCHAR

a...a

a...a: Data containing at least one character

  • abcdef[Figure]

  • ABCDEF

  • [Figure]

  • A number of characters up to the definition length of the column at the storage definition can be specified.

  • ...,,...

The enclosing character cannot be specified. Furthermore, single-byte spaces and tab characters cannot be inserted.

■ When data with a length of zero is specified

  • ...,"",...

If none is specified in the -k option, data with a length of zero cannot be specified.

7

Datetime data

DATE

{YYYY-MM-DD

|YYYY/MM/DD}

YYYY: Year (0001 to 9999)

MM: Month (01 to 12)

DD: Date (01 to the last day of the month)

  • 2013-06-10

  • 2013/06/10

  • Regardless of the format, one or more single-byte spaces or tab characters can be inserted before or after each character. #2

Same as No. 1

8

TIME

hh:mm:ss[.[nn...n]]

hh: Hour (00 to 23)

mm: Minute (00 to 59)

ss: Second (00 to 59)

nn...n: (n is 0 to 9)

  • 11:03:58

  • 11:03:58.

  • 11:03:58Δ.1234

  • A maximum of 12 characters can be specified for the fraction of a second (nn...n).#7

  • Regardless of the format or the restriction on the number of characters, one or more single-byte spaces or tab characters can be inserted before or after each character. #2

Same as No. 1

9

TIMESTAMP

{YYYY-MM-DD

|YYYY/MM/DD}

Δhh:mm:ss[.[nn...n]]

YYYY: Year (0001 to 9999)

MM: Month (01 to 12)

DD: Date (01 to the last day of the month)

hh: Hour (00 to 23)

mm: Minute (00 to 59)

ss: Second (00 to 59)

nn...n: (n is 0 to 9)

  • 2013-06-10Δ11:03:58

  • 2013-06-10Δ11:03:58Δ.1234

  • A maximum of 12 characters can be specified for the fraction of a second (nn...n).#7

  • Regardless of the format or the restriction on the number of characters, one or more single-byte spaces or tab characters can be inserted before or after each character. #2

Same as No. 1

10

Binary data

BINARY

For hexadecimal strings

a...a

a: 0 to 9, A to F, or a to f

  • 12340000

  • 90ΔAB

  • 90abΔCDEF

  • A number of characters up to twice the definition length of the column at the storage definition and that is a multiple of 2 can be specified.#8

  • Except for the beginning of data, 00 that continues to the end of data can be omitted.#9

  • Regardless of the format or the restriction on the number of characters, one or more single-byte spaces or tab characters can be inserted before or after each character. #2

Same as No. 1

11

For binary strings

a...a

a: 0 or 1

  • 01010101

  • 0101Δ0101

  • A number of characters up to eight times the definition length of the column at the storage definition and that is a multiple of 8 can be specified.#8

  • Except for the beginning of data, 00000000 that continues to the end of data can be omitted.#9

  • Regardless of the format or the restriction on the number of characters, one or more single-byte spaces or tab characters can be inserted before or after each character. #2

Same as No. 1

12

VARBINARY

For hexadecimal strings

a...a

a: 0 to 9, A to F, or a to f

  • 12340000

  • 90ΔAB

  • 90abΔCDEF

  • A number of characters up to twice the definition length of the column at the storage definition and that is a multiple of 2 can be specified.#8

  • Regardless of the format or the restriction on the number of characters, one or more single-byte spaces or tab characters can be inserted before or after each character. #2

  • ...,*,...

  • ...,"*",...

  • ...,,...

If none is specified in the -k option, examples that use the enclosing character cannot be specified.

■ When data with a length of zero is specified

  • ...,"",...

  • ...,"""",...

If none is specified in the -k option, data with a length of zero cannot be specified.

13

For binary strings

a...a

a: 0 or 1

  • 01010101

  • 0101Δ0101

  • A number of characters up to eight times the definition length of the column at the storage definition and that is a multiple of 8 can be specified.#8

  • Regardless of the format or the restriction on the number of characters, one or more single-byte spaces or tab characters can be inserted before or after each character. #2

Same as No. 12

Legend:

Δ: One or more single-byte spaces or tab characters

,: Delimiter

": Enclosing character

#1

If you specify an empty string when the DEFAULT clause is specified for a column at the storage location, the default value for the column is stored. When the DEFAULT clause is not specified for a column at the storage location, the null value is stored. If you want to store the null value in a column for which the DEFAULT clause has been specified, set the value of adb_import_null_string to NULL.

For details about the actual values to be stored in the target columns, see 17.8 Value that is stored for empty-string input data.

#2

If one or more single-byte spaces (0x20) or tab characters (0x09) are entered before or after a character, those single-byte spaces or tab characters are deleted.

Example: Δ1 Δ23 [Figure]4 [Figure] -> 1234

If all the data is deleted, an empty string is assumed.

#3

Any low-order digits that do not fit the scaling of the storage destination are discarded.

#4

If the exponent is omitted, +0 is assumed to be the exponent.

#5

Digit cancellation might occur depending on the specified value.

#6

If the input data is shorter than the defined length, trailing spaces are added.

#7

If the fraction of a second (nn...n) is shorter than the fractional seconds precision for the table's data type, trailing zeros are added.

If the fraction of a second (nn...n) exceeds the fractional seconds precision for the table's data type, the input data is truncated.

#8

A logical error results if the number of characters in the hexadecimal string is not a multiple of 2.

A logical error results if the number of characters in the binary string is not a multiple of 8.

#9

If the input data is shorter than the definition length, 0x00 is stored in the remaining portion.