Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2003
    Location
    Hong Kong
    Posts
    1

    Unanswered: Problem on import command

    I am a newbie to DB2. I would like to import a delimited ASCII flat file into database. The problem is that I cannot import the file successfully if there is a field which is of timestamp type.

    ::flat file::
    "USER",2003-10-03 11:03:08.804

    ::command::
    IMPORT FROM c:\document1.txt OF DEL MODIFIED BY coldel, chardel"" decpt. timestampformat=""YYYY-MM-DD HH:MMS.UUUUUU"" usedefaults MESSAGES c:\documentMsg.txt INSERT INTO DB2ADMIN.DOCUMENT ;

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


    However, it works if I omit milliseconds from the flat file and the script like this:

    ::flat file::
    "USER",2003-10-03 11:03:08

    ::command::
    IMPORT FROM c:\document1.txt OF DEL MODIFIED BY coldel, chardel"" decpt. timestampformat=""YYYY-MM-DD HH:MMS"" usedefaults MESSAGES c:\documentMsg.txt INSERT INTO DB2ADMIN.DOCUMENT ;


    I am using DB2 V7 on window2000. Thx for any help.

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Can you format like this: 2003-10-03 11:03:08.804000

    and not like this 2003-10-03 11:03:08.804

    That might work better.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •