Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL 'exclude' ???
Message
From
12/03/1998 12:10:25
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00084164
Message ID:
00084194
Views:
22
>I have a VFP table that has 60 fields. Instead of listing all of the fields I want for my resultant data, is there a way to say, give me all of the fields except for (unwanted fields).
>
>i.e(select * from county EXCLUDE ; county.street,county.name,county.test)
>
>Thanks for any help
>
>John

Hi John,
Here is another "excluder" function.
use customer
cFieldList = exclude("contact,company")
? cFieldList
select &cFieldList from customer

function exclude
lparameters cExcludelist
dimension aExclude[1]
nWords = WordArray(upper(cExcludelist),@aExclude)
cFields = ""
for ix = 1 to fcount()
    lInlist = .f.
    for kx = 1 to nWords
        if field(ix) == aExclude[kx]
		    lInlist = .t.
		    exit
		endif
    endfor
    if !lInlist
       cFields = cFields + ;
       		iif(empty(cFields),"",",")+;
       		field(ix)
    endif
endfor
return cFields

function WordArray
parameters cWordList, aWordArray  && Comma delimited word list, array that words will be placed
oDummy = createobject("Listbox")
with oDummy
	.RowSourceType = 1
	.RowSource = cWordList
	dimension aWordArray[.listcount]
	for ix = 1 to .listcount
	    aWordArray[ix] = .list(ix)
	endfor
endwith
release oDummy
return alen(aWordArray)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform