Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ODBC speed
Message
De
06/07/1998 23:24:40
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00114683
Message ID:
00114779
Vues:
16
Stephen ---

>
>It appears that the "create sql view" statement and the
>"select ... from carriers" statement take about the same length of time.
>When I comment out the create sql view statement, it cuts the
>time in half, but it still takes too long in my opinion to do the
>"select statement" (Minimum of 5 seconds). The CLOSE and OPEN DATABASE statements take virtually no time.
>

I think the point that you are missing is that you want to create remote view structures in your database container and not run *any* SELECTS runtime. You see, a remote view encapsulates the SELECT SQL statement and it should never be manually run again. You simply open the view as a table. There si also SQL Passthrough where you SQLEXEC() statements but that is not what you appear to be trying to do. Read on.

>I imagine Foxpro must be reading the remote data dictionary for the "create" and reading the data itself into "local" memory for the "select" statement, hence two hits on the ODBC source.
>
>I also jacked up the buffers/packet size, to no avail. (There's only 5 rows and 2 columns in the table).
>
>Anyway, this is the "improved" version.
>
>CLOSE DATABASES
>OPEN DATABASE ('d:\apss-win\240\usp')
>*DELETE VIEW testodbc2
>*create sql view testodbc2 connection HazMat;
>* as select id,carrier from carriers
>select * from testodbc2
>
>****************************************************
>Is creating a view the ONLY way to bring data across
>an ODBC connection?
>****************************************************

Type this: Create a PRG file containing the OPEN DATABASE and CREATE SQL VIEW commands aforementioned. COMPILE it and DO it. If you MODIFY DATABASE \apss-win\240\usp you will see the view testodbc2. It is permanently created. It does not have to be recreated whenever you open the database. Subsequent use of the view should be along the lines of:

OPEN DATABASE ('d:\apss-win\240\usp')
USE usp!testodbc2

Thats it! No mess, no fuss. The connection and view team up to do the SELECT statement on the back-end.

Please try this out and get back with me, OK?
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform