Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Speed up loop queries
Message
 
À
28/06/2002 08:11:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00673211
Message ID:
00673242
Vues:
12
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?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform