Db2 loading from Tab delimited Txt file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ananthaisin
    New Member
    • Aug 2008
    • 15

    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.
  • ganeshmn25
    New Member
    • Aug 2008
    • 28

    #2
    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

    Comment

    • spider007
      New Member
      • Jan 2007
      • 27

      #3
      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 ....

      Comment

      • ananthaisin
        New Member
        • Aug 2008
        • 15

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

        Coming up with more questions..:)

        Comment

        • spider007
          New Member
          • Jan 2007
          • 27

          #5
          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..

          Comment

          Working...