You use this syntax rule to specify the data format of the plain text values in which TIMESTAMP columns are entered and displayed. A time stamp consists of a date value, a time value, and microseconds.
This format only applies to the load or unload command in which it is specified. If a time stamp format is not specified in a command, then either the Loader default is used, or a value specified with the SET TIMESTAMP command. You use the SET TIMESTAMP command to specify the time stamp format for all subsequent commands. In a single Loader session, this applies until a new SET command is executed.
<timestamp_spec> ::= TIMESTAMP
<standard_timestamp_mask>
| TIMESTAMP '<valFREE_MASK>'
<standard_timestamp_mask> ::= EUR | INTERNAL | ISO | JIS | USA
valFREE_MASK |
Freely definable output format Use Y for the year, M for the month, D for the day, H for the hours, M for the minutes, S for the seconds, and N for the microseconds. |
You use the standard_timestamp_mask to specify the format for plain text values in which TIMESTAMP columns are entered and displayed.
The default value in the Loader is INTERNAL.
'YYYY' |
Year (four digits) |
'MM' |
Month (two digits, 01-12) |
'DD' |
Day (two digits, 01-31) |
'HH' |
Seconds (two digits, 0-24) |
'MM' |
Minutes (two digits, 00-59) |
'SS' |
Seconds (two digits, 00-59) |
'NNNNNN' |
Microseconds (six digits) |
Format |
General Form |
Example |
EUR/JIS/USA |
'YYYY-MM-DD-HH.MM.SS.NNNNNN' |
'2005-01-23-14.30.08.456234' |
INTERNAL |
'YYYYMMDDHHMMSSNNNNNN' |
'20050123143008456234' |
ISO |
'YYYY-MM-DD HH:MM:SS.NNNNNN' |
'2005-01-23 14:30:08.456234' |
Years must have
four digits. Months and days must have two digits.
Hours, minutes, and seconds must have two digits.
For microseconds, you can choose any number of digits from 0 to 6.
Time stamp format in a command
CREATE TABLE ts_test (col1 TIMESTAMP)
//
INSERT INTO ts_test VALUES (TIMESTAMP)
//
DATAEXTRACT * FROM ts_test
OUTSTREAM 'ts_test.data'
TIMESTAMP ISO
Example of the content of the target data stream: ?2003-05-15 11:36:55.123456?
You use the output format valFREEMASK to specify the format for plain text values in which TIMESTAMP columns are entered and displayed.
Freely definable display in a command
CREATE TABLE ts_test (col1 TIMESTAMP)
//
INSERT INTO ts_test VALUES (TIMESTAMP)
//
DATAEXTRACT * FROM ts_test
OUTFILE 'ts_test.data'
TIMESTAMP 'YYYY-MM-DD-HH-MM-SS-NNNNNN'
Example of the content of the target data stream: ?2005-11-15-13-14-12-987654?