Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Speed up loop queries
Message
From
28/06/2002 08:11:40
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Speed up loop queries
Miscellaneous
Thread ID:
00673211
Message ID:
00673211
Views:
47
I have a program in VFP 5.0 that builds a sql query for each record it needs to update and then issues that SQL query to an Oracle db on each loop. The pertinent code is (where gnOracleconnection is a definition of the ODBC connection to the database):

num_to_update = reccount()
for ctr = 1 to num_to_update




** Send the SQL statement to the Oracle database
returnValue=sqlexec(gnOracleConnection, sqlString)

if returnValue=-1 then &&if sqlexec failed
errormessage = "The Oracle connection gnConnection value is " + str(gnOracleConnection) + chr(13)
errormessage = errormessage + "The error number should be " + str(error())+ chr(13)
errormessage = errormessage + "The error message should be " + message() + chr(13)
errormessage = errormessage + "The ticket number being updated was " + alltrim(RECORDNUM) + chr(13)
messagebox(errormessage)
return
endif


next

The program takes a while to execute in this fashion. Is there anything that could be done to speed it up?
Next
Reply
Map
View

Click here to load this message in the networking platform