Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Any VB / DB2 experts out there?

Status
Not open for further replies.

tbt102

Programmer
Jan 1, 2002
61
US
Hi, all

i'm witting an application that is loading data into database tables via numerous inserts. The insert of a few hundred records is taking hours.

After a review the code I believe that the application will benefit from preparing the insert SQL statements prior to execution.

I review the CLI manual and it was not clear for VB.

Question is there any sample code that demonstrates how to prepare insert SQL statements within a Microsoft Visual Basic (VB) application?

Environment
===========
> Windows 2000 service pack 3
> DB2 UDB EE 7.2 fix pack 9
> Microsoft Visual Basic 6.0

Thanks in advance for any help.
 
When you say "Prepare" are you referencing building them and storing them some how prior to execution?

If so I had the same task awhile back and I also found execution time to be a bit better after building the INSERT's and building a array for each on them as they pertained to their specific needs.

Honestly I was surprised at the increase in efficiency as the build --> array creation along with an interation through the array for each execute seemed much more hogging then hitting the DB on each build. It did help though! Hardware may have played a role in that speed also as it always does. So that suggestion may not help in your environment.

___________________________________________________________________

The answer to your ??'s may be closer then you think.
Check out Tek-Tips knowledge bank by clicking the FAQ link at the top of the page faq333-3811
 
onpnt,

Sorry about the delay. I got sidetrack.

Building them and storing them some how prior to execution is exactly what I need 2 do.

I also need to have way to pass in values/parameters.

Thanks in advance for any help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top