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 > import data from csv file in db2 table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-22-11, 18:16
beetri beetri is offline
Registered User
 
Join Date: Dec 2011
Posts: 3
import data from csv file in db2 table

I m novice to db2.

Import from 'c:\temp\devtest.del' of del insert into devtestone(col1,col2)

gives the error as:

15:13:51 [IMPORT - 0 row(s), 0.000 secs] [Error Code: -104, SQL State: 42601] DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=Import from 'c:\temp\devtest.del' of del;BEGIN-OF-STATEMENT;<space>, DRIVER=3.57.82
... 1 statement(s) executed, 0 row(s) affected, exec/fetch time: 0.000/0.000 sec [0 successful, 0 warnings, 1 errors]


Please advice,
Thanks,
Reply With Quote
  #2 (permalink)  
Old 12-23-11, 00:28
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
What DB2 version and OS are you using? How are you trying to execute the import statement?

Andy
Reply With Quote
  #3 (permalink)  
Old 12-23-11, 02:00
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
publish some rows of data from the infile
and the layout of the table
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #4 (permalink)  
Old 12-23-11, 09:13
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
IMPORT is not an SQL statement; it is a CLP command and must be run from the CLP. If you insist on using the SQL interface, consider ADMIN_CMD(): IMPORT using ADMIN_CMD - IBM DB2 9.7 for Linux, UNIX, and Windows
Reply With Quote
  #5 (permalink)  
Old 12-29-11, 18:33
beetri beetri is offline
Registered User
 
Join Date: Dec 2011
Posts: 3
thank you for the response.

Now I m executing:
CALL SYSPROC.ADMIN_CMD ('Import from c:/temp/devtest.del of del insert into devtestone(col1,col2)')

I get error as:

15:07:49 [CALL - 0 row(s), 0.000 secs] [Error Code: -3030, SQL State: ] DB2 SQL Error: SQLCODE=-3030, SQLSTATE= , SQLERRMC=sqlofopn -2029060079, DRIVER=3.57.82
... 1 statement(s) executed, 0 row(s) affected, exec/fetch time: 0.000/0.000 sec [0 successful, 0 warnings, 1 errors]


I m using db2 9.7
and table lay out is

col1 (decimal) col2(VARCHAR)
========== ===
1 testone
2 testtwo
Reply With Quote
  #6 (permalink)  
Old 12-30-11, 06:13
manuavaran manuavaran is offline
Registered User
 
Join Date: Dec 2011
Posts: 27
i tried this in an another method by using "ADOX.Catalog" object .. i got he result
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