Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Speed up loop queries
Message
 
To
28/06/2002 08:11:40
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00673211
Message ID:
00673242
Views:
13
Just a thought, but, you might want to use SYS(3050,1,VAL(SYS(3050,1,0))/3) to make sure your app is only using 1/3 of available memory. Otherwise it will hog memory to the point of slowdowns. Also, putting Sleep(0) in your loop may help other needed system processes to run.
>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?
Previous
Reply
Map
View

Click here to load this message in the networking platform