Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQLPREPARE() command...what is it good for?
Message
 
À
30/03/2004 04:28:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00890609
Message ID:
00890768
Vues:
14
As many have noted MS SQL Server in their replies, I guess I should mention that MS SQL Server is not the data source that I have to work with in this particular situation. I guess I should have mentioned that earlier :)

We have a situation where a 3rd party has supplied an ODBC driver for a proprietary database format. In our project we are to read data from tables in this proprietary database using the ODBC drivers that were supplied.

We created a connection and are using SQLEXEC() to open cursors of data from tables in the proprietary database. The problem is that opening these tables takes forever and a day. I was sort of hoping maybe using SQLPREPARE() might be the answer to my speed issues.

Thanks,
Don

>
>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.
Don Knoup
don.knoup@ticomix.com
Ticomix, Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform