Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select all except
Message
From
20/11/2007 13:44:33
 
 
To
20/11/2007 11:14:49
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01269471
Message ID:
01270234
Views:
19
>>>>Is it possible to SQL-Select all fields except 1 ? Something like:
>>>>
>>>>SELECT * except somefield from . ...
>>>>
>>>>I have a large table with many fields and want to retrieve all but one field.
>>>
>>>See download #10041 and anything from Frank Dietrich that's related to intellisense - there's a macro which will build a Select statement for any alias that's open while you're typing. So you can use the FIELDLIST macro and have all the fields listed, then just erase the one field you want erased.
>>>
>>>Another way to get the same is to
>>>
Select * from ... into cursor tmp ... nofilter readwrite
>>>alter table ... drop column somefield
>>>
>>>Don't remember the exact syntax for the drop. If you want to avoid getting the field even temporarily (because it's too long, or because it's a memo), then you need a full select statement. You may use Frank's macro, or build a field list as a string with that one field omitted, then use such a field list in a script that you'll execscript(), or run as a macro.
>>
>>Have you ever done this? Every time I've tried to alter table with a cursor I get an error that says it is an invalid operation for a cursor.
>
>The cursor must be read-write, then it's "legal".

I must have something wrong. This code fails for me.
select * from tip into cursor temp readwrite
alter table temp add column sc20 c(10)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform