Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ALTER TABLE on SQL Select cursor
Message
From
06/12/2002 21:23:47
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00730441
Message ID:
00730568
Views:
17
Thanks, Sergey - The example I show has no field name longer than ten characters ... but that wasn't the example I tested < s >

SELECT ccompany FROM customers INTO CURSOR temp READWRITE
ALTER TABLE 'temp' ADD COLUMN url m

works fine. ( didn't want someone else to be confused by my error )

In the example I test, if I alias the field in the select statement to a 10 character name all works well.

SELECT cfirst,clast,celementary_school as celem ;
FROM ambassadors INTO CURSOR temp readwrite
ALTER TABLE 'temp' ADD COLUMN mnotes m

Handy to know.


>In VFP7 ALTER TABLE doesn't work on cursors with field names longer than 10 characters.
>
>>In the tips in the back of the Sept 2002 UT magazine :
>>
>>Sometimes, you may want to add some fields to a cursor. Assuming, you have created your cursor in READWRITE mode, you could do the following:
>>
>>ALTER TABLE 'temp' ADD COLUMN cImage c(20)
>>
>>Since this mentions readwrite I assume it refers to a cursor created with a SQL Select
>>
>>SELECT ccompany FROM cutomer INTO CURSOR temp READWRITE
>>ALTER TABLE 'temp' ADD COLUMN url m
>>
>>When I do this I get an 'Invalid operation for the cursor' message.
>>
>>I was hoping this would be a shortcut around the old dummy cursor Cartesian join trick. What am I missing?
>>
>>TIA


Charles Hankey

Though a good deal is too strange to be believed, nothing is too strange to have happened.
- Thomas Hardy

Half the harm that is done in this world is due to people who want to feel important. They don't mean to do harm-- but the harm does not interest them. Or they do not see it, or they justify it because they are absorbed in the endless struggle to think well of themselves.

-- T. S. Eliot
Democracy is two wolves and a sheep voting on what to have for lunch.
Liberty is a well-armed sheep contesting the vote.
- Ben Franklin

Pardon him, Theodotus. He is a barbarian, and thinks that the customs of his tribe and island are the laws of nature.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform