Topic
  • 2 replies
  • Latest Post - ‏2014-08-07T10:14:59Z by rggnanaraj
rggnanaraj
rggnanaraj
99 Posts

Pinned topic IMPORT from ASC file fails using DATEFORMAT

‏2014-08-07T07:42:47Z |

The input file has date as listed below:

 2014-06-28

Use of dateformat="YYYY-MM-DD" in the IMPORT command still fails with SQL3192N.

db2 "import from input.asc of asc modified by dateformat="YYYY-MM-DD" method L (1 10) insert into tdate(ttdate)"

 "SQL3192N In the filetmod a user specified format "DATEFORMAT" beginning with the string "YYYY-MM-DD"   is not valid."

Am I missing something here?

Thanks in advance.

  • mor
    mor
    507 Posts
    ACCEPTED ANSWER

    Re: IMPORT from ASC file fails using DATEFORMAT

    ‏2014-08-07T10:05:14Z  

    you are not escaping the quotes around the date-format-pattern and they are being swallowed by your command shell...

    you failed to mention your operating system..

     

    if using some kind of unix then the backslash \"  is used often as the escape character

    if using Windows db2cmd accepts caret as an escape character

  • mor
    mor
    507 Posts

    Re: IMPORT from ASC file fails using DATEFORMAT

    ‏2014-08-07T10:05:14Z  

    you are not escaping the quotes around the date-format-pattern and they are being swallowed by your command shell...

    you failed to mention your operating system..

     

    if using some kind of unix then the backslash \"  is used often as the escape character

    if using Windows db2cmd accepts caret as an escape character

  • rggnanaraj
    rggnanaraj
    99 Posts

    Re: IMPORT from ASC file fails using DATEFORMAT

    ‏2014-08-07T10:14:59Z  
    • mor
    • ‏2014-08-07T10:05:14Z

    you are not escaping the quotes around the date-format-pattern and they are being swallowed by your command shell...

    you failed to mention your operating system..

     

    if using some kind of unix then the backslash \"  is used often as the escape character

    if using Windows db2cmd accepts caret as an escape character

    Thanks a ton!

    It is working now after including the escape character (\) before the double quotation.