I am importing an SQL standard TIME(3) column into DB2 form a CSV file using the IMPORT utility.
The source database that produced the export has the times in the format TIME(3) i.e. HH:MM:
SS.UUU. There are no options on the CSV export to manipulate this.
DB2 only supports TIME with no decimal places (effectively TIME(0)).
If I try the following to specify the source time format on the import it fails with
"SQL3192N In the filetmod a user specified format "TIMEFORMAT" beginning with the string ""HH:MM:SS.UUU"" is not valid."
Quote:
IMPORT FROM "filename.csv" OF DEL
MODIFIED BY dateformat="YYYY-MM-DD"
timeformat="HH:MM:SS.UUU"
timestampformat="YYYY-MM-DD HH:MM:SS.UUU"
coldel|
nochardel
keepblanks
codepage=1252
REPLACE INTO tablename (col1, col2, ...);
|
I was hoping that the import utility could drop the decimal places on the import and just give me a warning.
So I tried:
Quote:
IMPORT FROM "filename.csv" OF DEL
MODIFIED BY dateformat="YYYY-MM-DD"
timeformat="HH:MM:SS"
timestampformat="YYYY-MM-DD HH:MM:SS.UUU"
coldel|
nochardel
keepblanks
codepage=1252
REPLACE INTO tablename (col1, col2, ...);
|
Which fails with
"SQL3191N The field in row "1", column "12" which begins with "09:00:00.000" does not match the user specified DATEFORMAT, TIMEFORMAT, or TIMESTAMPFORMAT. The row will be rejected."
Does anyone know of a way to get the data imported?
DB2 9.7.2 on Windows
Thanks,
Mark.