Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
I have never used the SQLPREPARE() command before and I was wondering if anyone could tell me a bit about where and when this command would be useful. It seems from reading the help file that issuing a SQLPREPARE prior to a SQLEXEC() may make the SQLEXEC() run faster?
Is that true?
Thanks,
Don
Usefull:
Only if the SQL command is repetitive.
Normally, it is correlate with parametric commands.
Before VFP8 it was not much profit.
On VFP8, you can declare a Shared connection
( i use only shared connections because ODBC use only Statements for send commands);
then you can define multiple nStatementHandle into a connection
( VFP ODBC handle are nStatementHandle into all the revision );
then you can bind ( with SQLPREPARE(nStatementHandle,...) )
one different SQL command with every nStatementHandle,
and reexecute it ( with eventual new parameters ) with only SQLEXEC(nStatementHandle).
The speed can increase if the command is complex,
but if the command is not ambiguous,
SQL2K can jump the compilation phase and then the speed can not change.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement