Click here to Skip to main content
15,879,095 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a CSV file which has some amount of data for which we are planning to move the data to a DB2 table (its only one time job). So I was planning of something using BulkInsert (sorry if I am wrong as I don't have any knowledge of DB2) through C# code. So please suggest how to write the code in C# to use DB2 bulkinsert functionality, also is it preferable to use the bulkinsert operation or is there any other best possible way. Currently I am thinking of running through each list item and calling insert statement on the table.

Thanks in advance.
Posted

1 solution

Since this is a one time job looping through might just be the easiest way to do it.

However, with Oracle we have SQLLoader which takes a control file and the data file and will do the work for you. I looked and DB2 has 2 tools that appear to be similar

DB2 LOAD and DB2 IMPORT

Here's a link I found discussing them.
http://www.ibm.com/developerworks/data/library/techarticle/dm-0808khatri/[^]
 
Share this answer
 
Comments
gettgotcha 13-Dec-13 11:40am    
Thank you. Seems like looping is the best option.
bowlturner 13-Dec-13 11:42am    
Your welcome. I would suggest eventually becoming familiar with the other tools, they can come in handy.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900