Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Speeding up my query
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01034597
Message ID:
01034655
Views:
16
>Today my way of expression is horrible (not that other days is not) :o)
>You said that SELECT-SQL doesn't use already opened files, but if I run something like SELECT * FROM MyTable INTO CURSOR cTest and then open Data Session window, there is 2 aliases there - MyTable and cTest, but if do something like:
>
>USE MyTable
>SELECT * FROM MyTable INTO CURSOR cTest
>
>and open Data Session window again only 2 aliases are there - MyTable and cTest, there is no addional alias like "B" or "MyTable_B". That is why I think SELECT-SQL uses already opened tables.

If table is not open before a query, VFP'll open it and use in a query. It stays open after query is completed.
If a table is already open, than VFP will open it similar to USE AGAIN with a temp alias and use that alias in a query. The temp aliases are closed after query is completed.

You can see it yourself by creating a simple UDF and running following query (you can use any table instead of 'mytable')
* FUNCTION myudf
SUSPEND
RETURN "A"
...
SELECT *, myudf() ;
  FROM mytable ;
  INTO CURSOR temp
Run query twice. First time with mytable claused and second open before query and anylize all workareas in the Datasession window.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform