Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I drop it?
Message
From
29/11/2013 12:01:42
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
To
29/11/2013 11:14:41
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01588891
Message ID:
01588894
Views:
95
>I created a cursor. I did some additional processing after that cursor was created. Now there's a column I don't need anymore.
>
>How do I get rid of that column?
>
> I tried the following
>
>ALTER table NameOfCursor drop column NameOfColumn
>
>Didn't work.
>Error 1115 : Invalid operation for the cursor.
>
>Is the only solution creating another cursor and selecting only the needed columns from the original cursor?

Which shouldn't be that hard:
afiel(aF,"nameOfCursor")
lnElement=ascan(af, "myfieldname") && mind the other parameters here - case sensitivity, perhaps search only column 1
lnRow=asubscript(af, lnElement, 1) 
adel(af, lnRow)
dimension af(alen(af,1)-1, alen(af,2))

create cursor newname from array af
append from dbf("nameOfCursor")

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