Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select Into 'self' not possible after Use Again
Message
 
To
09/03/2000 08:11:37
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00343598
Message ID:
00351900
Views:
27
Hi Cetin,

Here is a way to reproduce what I mean, I create a cursor and then I'd like to make it read/write by using it again. I do this twice because I want it to have the same name. I'm not looking for an other way to do this but I'd like to find out why I get an "alias is already in use" error when I have reused it and not otherwise. In the code below it works fine but I don't have the tmp Cursor Read/Write. When you uncomment the commented lines you'll have a read/write tmp Cursor but the error will occur then.

select * from table into cursor tmp nofilter
use dbf('tmp') again in 0 alias tmp2
* use in tmp
* select tmp2
* use dbf('tmp2') again in 0 alias tmp
* use in tmp2
select * from tmp into cursor tmp


>>>
Mark,
>>>Other than some cleanup benefits cursors are "always" written to disk. IMHO take the easy way and select into table.
>>>OTOH if you have a DBC open (or create a temp one) you could create-drop a temp view on the fly.
>>>Cetin
>>
>>Cetin,
>>I'm actually not looking for the 'easy way'; I want to know what happens and why it doesn't work.
>
>
W/o seeing some code my best guess is that you're not selecting into a true cursor. You could make a true cursor :
>-Including a dummy nonexistant field in SQL
>select *, 1 as myDummy ...
>-Including a dummy .t. expression in where
>select * rom myTable where .t. [ and ...] ...
>Above are also FP2x compliant. In VFP you could also :
>-Use "nofilter" clause
>select ... nofilter
>
>A sample readwrite cursor :
>
select * from myTable into cursor crsTemp nofilter
>use (dbf("crsTemp")) in 0 again alias "myRW"
>use in ("crsTemp")
>select myRW
Cetin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform