Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP 6.0 sql select to cursor
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00340471
Message ID:
00340607
Views:
35
>The proper way would be to select into a table. Your job becomes destroy the newly-created table when you're done with it.
>
>With a SQL Select based on a single table, where the query is fully optimized, you may be getting a filtered view rather than an actual cursor; if you did anything to update it the results would be devastating, since your underlying store is the actual base table. You have to add the NOFILTER clause to the SELECT to ensure that this does not happen.
>
>Once you have a real cursor, replace the "select mycursor" with:
>
>USE (DBF()) AGAIN IN 0 ALIAS MyCursor2
>USE
>SELECT MyCursor2
>
>MyCursor2, the re-use of the cursor in a new area, should be writable, and should go away when you release it via USE/CLOSE DATA or the like.
>
>You can alter the initial SELECT to result in MyCursor being writable by making the code appear as follows:
>
>select name, section from tablename into cursor (SYS(2015)) NOFILTER
>USE (DBF()) AGAIN IN 0 ALIAS MyCursor
>USE
>SELECT MyCursor
>replace all section with "A" for section = "V"


Thanks everyone for the help and advice. Right now I think I'll do the sql into a tablename nofilter, but the other options our very interesting and given some free time (never enough of that) I'll try them too.

Jim Harvey
jharvey@netrax.net
Previous
Reply
Map
View

Click here to load this message in the networking platform