Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old August 14th, 2008, 09:53 AM
Newbie
 
Join Date: Aug 2008
Posts: 6
Default Db2 loading from Tab delimited Txt file

Hi all,

I am pretty much new to DB2 platform and i have one query...

I have to import data of about 7 million rows into a Db2 table.

i am using the following import statement right now

db2 "import from file_name of del insert into table_name"

But i was told the default delimiter is Comman(,) ,the case here is i have a tab delimited Txt file.So can someone help me out with the correct import statement.

Also i need to commit after every 2000 records in the same import statement.
Reply
  #2  
Old August 14th, 2008, 11:26 AM
Newbie
 
Join Date: Aug 2008
Posts: 24
Default

Hi ananthaisin ,

This is the command that will suite for your reqirements

db2 "import from file_name of del commitcount 2000 insert into table_name"

Regards

Padmanaban
DB2 Associate
Reply
  #3  
Old August 15th, 2008, 06:22 AM
Newbie
 
Join Date: Jan 2007
Posts: 27
Default

I think you will have to modify the tab delimited file to a csv or any other delimiter. For example, if the delimiter is "^", then you can use

db2 import from filename of del modified by coldel^ insert into ....
Reply
  #4  
Old August 16th, 2008, 11:41 AM
Newbie
 
Join Date: Aug 2008
Posts: 6
Default

Ty guys really helped me out.....but the loading is so slow duno why....

Coming up with more questions..:)
Reply
  #5  
Old August 17th, 2008, 06:11 AM
Newbie
 
Join Date: Jan 2007
Posts: 27
Default

Import utility is just like insert statements and hence wil take some time. Load, on the other hand, is very fast but you will not be able to commit after every 2000 rows. if there is no req for commiting every 2k rows, you can use load.
You may also want to look at this article: http://www-128.ibm.com/developerworks/db2/library/tips/dm-0403wilkins/

Oldie but goldie..
Reply
Reply

Bookmarks

Thread Tools

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 Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles