General information
Title:
Speed up loop queries
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only