Performance of SQL Passthru Query in a loop

|
|
|
GaryG
Arrow Box Company
|
Hello,
I have a need to execute a SQL Passthru query(SQL Server) inside a loop. The loop number will be hundreds per day. In the example below, this loop of 100 takes about 6 seconds. Using SQL Profiler, I can see the stored procedure itself executes in 0 milliseconds. It appears to me that all of the processing time is spent executing the objectPal method 'executeSQL'. Example code below. Do you have any ideas/tips on improving this performance?
Thanks,
Gary
method pushButton(var eventInfo Event) var sqlSQL SQL db Database dynAlias DynArray[] AnyType tc TCursor cnt SmallInt LoadTagUnitID LongInt endVar
dynAlias["USER NAME"] = "USERNAME" dynAlias["PASSWORD"] = "PASSWORD" db.open (":ArrowSys:", dynAlias)
for cnt from 1 to 100 sqlSQL.wantInMemoryTCursor(Yes) sqlSQL.readFromString("execute spParaBox_LoadTagUnitInsert 195195, " + String(cnt) + ", 100;")
executeSQL(db, sqlSQL, tc) LoadTagUnitID = tc."LoadTagUnitID" tc.close() endFor endMethod
|
|
Posted 5 years ago (Thread Starter)
|
|
| About GaryG |
|
Membership pending.
Member subscribes to this thread but email is NOT VERIFIED.
|
Email Not Verified!
Once email is verified, we will review and approve the account.
|
|
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html,
social networking links, message board signature, company profile, etc.
|
Post ID #18376, 1 reply
Thread Started 1/20/2021 8:39:21 AM
View Counter=632
|
|
|
|
Location=0
|
|
| |
Most Recent Post
|
|
|
Steven.G
|
I don't think there's any way to make a significant change, other than "fastest machine you have".. you can do 1000 loops in a minute.. that seems quite reasonable
Steven Green Senior Software Engineer Paradox Support Specialist DOS/WIN
Prestwood IT Solutions 8421 Auburn Blvd, Suite 256, Citrus Heights, CA 95610 Office: 916-726-5675 | Fax: 916-726-5676 | http://www.prestwood.com
|
|
Posted 5 years ago
|
|
| About Steven.G |
|
Approved member.
Member subscribes to this thread with a verified email.
|
Old Account!
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
|
|
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html,
social networking links, message board signature, company profile, etc.
|
Post ID #18377 (Level 2)
and Parent is 18376
Reply Posted 1/20/2021 9:07:01 AM
|
|
|
|
Location=Myrtle Beach, SC USA
|
|
Revive Thread!
Add a comment to revive this old thread and make this archived thread more useful.
| Thread #18376 Counter |
| 632 |
|
Since 1/20/2021
|
|
|