Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tip o' the Day: ALTER TABLE on a Cursor
Message
From
16/02/2001 12:54:05
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00476591
Message ID:
00476716
Views:
24
>>I just found out this works, with a caveat (at least in VFP5). I used a complex SELECT - SQL to generate a report cursor. I wanted to add a memo column to the resultant cursor:
* Report cursor:
>>SELECT ;
>>  ... ;
>>  INTO CURSOR MyCursor ;
>>  ...
>>
>>* Make the cursor read-write:
>>USE ... AGAIN etc.
>>
>>* Add the memo column:
>>ALTER TABLE ... ADD COLUMN MyMemo M
>>
>>BTW can anyone confirm if this works in VFP6?
>
>Yep, this still works in VFP6. Now, can someone tell us if it works with VFP7 and just using the READWRITE clause of the SELECT and the ALTER TABLE?

It complained about the table being still open elsewhere - it worked only after I closed the original r/o cursor. Does make sense, that one was read only, and was open in another workarea.

This thing should actually gain us some speed, specially when we had to include dummy fields in a select statements to be placeholders for later additions - we now can do them outside of the SQL statement. What I'm saying is that instead of
select ..., space(40) as name, ...
we can now do the select without this, and add the field afterwards. This should lift some burden off SQL's back.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform