Search code examples
db2-luw

Load giving me error SQL3192N for my dateformat


I am trying to load data into db2 using the following command and get errors.

db2 load client from 5rec.csv of del replace into t1

SQL0180N The syntax of the string representation of a datetime value is incorrect. SQLSTATE=22007

SQL3185W The previous error occurred while processing data from row "F0-1" of the input file.

my dates are either null or of the format 30/8/1938 which is D/M/YYYY so I tried the following but still get errors.

db2 load client from 5rec.csv of del modified by dateformat="D/M/YYYY" replace into T1

SQL3192N In the filetmod a user specified format "DATEFORMAT" beginning with the string "D/M/YYYY" is not valid.

What am I doing wrong?


Solution

  • You must escape double quotes, if you run such a command from a shell.
    Try the following:

    db2 "load client from 5rec.csv of del modified by dateformat=\"D/M/YYYY\" replace into T1"