If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Problem on import command

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-07-03, 04:51
schiang schiang is offline
Registered User
 
Join Date: Nov 2003
Location: Hong Kong
Posts: 1
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.
Reply With Quote
  #2 (permalink)  
Old 11-07-03, 05:07
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On