Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / May 2006

Tip: Looking for answers? Try searching our database.

Bulk insert from a CSV file to a DB2 file. How?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nexus - 30 May 2006 18:53 GMT
I have created a program in Visual Basic that creates CSV file on the PC.

However I need to do an upload of these files into DB2 tables (from time to
time)

I'm currently using ADO to create a connection to the DB2 table and update
the records using a SQL Insert command.

The program goes through each row in the CSV file and performs an SQL insert
statement for each row until the file is completely processed.

This is however very slow an I'm getting only around 40 rows inserted a
second, and the file can sometime have over 10,000 rows.

Is there any way to speed this up?

BULK INSERT commands?

Batching commands etc.

Any help would be much appreciated
Mehmet Baserdem - 30 May 2006 20:23 GMT
You can issue a command smthg similar to this

db2 load  from  filepath   of  del  insert into your_table

Please refer to below for detailed information:

http://publib.boulder.ibm.com/infocenter/db2luw/v8//topic/com.ibm.db2.udb.doc/co
re/r0008305.htm


regards,

Mehmet Baserdem
Nexus - 30 May 2006 20:44 GMT
Does the file have to reside on the server and how do you call the routine
from Visual Basic?

Can this be done using the ADO Command object and is so, what is the syntax
(if you know).

Note I'm importing data from a PC CSV file to an AS400 DB2 database.

Thanks

> You can issue a command smthg similar to this
>
[quoted text clipped - 7 lines]
>
> Mehmet Baserdem
Mehmet Baserdem - 30 May 2006 22:14 GMT
Input file can reside on the client. ( refer to "CLIENT" option)

I have no idea/prior experience about sending this command through ADO
Command object.  But you can use a stored procedure  with ADO
Commandtype = StoredProcedure.

db2load stored procedure:
http://www-1.ibm.com/support/docview.wss?uid=swg21201292

Regards,

Mehmet Baserdem
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.