You use this syntax rule to specify the data format of the plain text values in which DATE columns are input and output. This format only applies to the import or export command in which it is specified. If no date format is specified in a Loader command, either the Loader default or a value specified with the SET DATE command is used. You use the SET DATE command to specify the date format for all subsequent commands. In a Loader session, this applies until a new SET command is executed.
Syntax
<set_date_command> ::= SET DATE <standard_date_mask> <date_spec> ::= DATE <standard_date_mask> | DATE '<free_mask_date>' <standard_date_mask> ::= EUR | INTERNAL | ISO | JIS | USA
'YYYY' |
Four-digit year format |
'MM' |
Two-digit month format (01-12) |
'DD' |
Two-digit day format (01-31) |
Format |
General Format |
Example |
---|---|---|
EUR |
'DD.MM.YYYY' |
'23.01.2008' |
INTERNAL |
'YYYYMMDD' |
'20080123' |
ISO/JIS |
'YYYY-MM-DD' |
'2008-01-23' |
USA |
'MM/DD/YYYY' |
'01/23/2008' |
Day and month entries must have two digits. The year must have four digits.
This setting of a standardized date mask using the SET DATE command applies to the entire Loader session if the date mask is not changed by another SET DATE command.
You can change the current date mask for Loader commands by using the syntax element date_spec to define the data format (field_format_spec).
You use the standard_date_mask to specify the format for plain text values in which DATE columns are input and output (default value: INTERNAL).
You use any date mask free_mask_date to specify the format for plain text values in which DATE columns are input and output. Use Y for the year, M for the month, D for the day. Years must have two or four characters, days must have two characters, and months must have two characters.
Example
EXPORT TABLE hotel.reservation
DATA OUTSTREAM 'reservation_csv.data'
DATE ISO
Standard date mask ISO is specified.
Example
IMPORT TABLE hotel.reservation
DATA INSTREAM 'reservation_csv.data'
DATE 'YY-MM-DD'
Example of the content of the data stream:
"100","3000","80","single","05-11-13","05-11-15"
Any mask YY-MM-DD is specified for dates.