Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL SELECT question
Message
From
03/02/2000 04:32:38
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00326312
Message ID:
00326582
Views:
25
>Using VFP data I have a SQL statment like the following:
>
>
>SELECT * FROM Buildings WHERE ASCAN(aProjects,ProjID)#0 INTO CURSOR cBuildings
>
>
>How would I do something logically similar for a parameratized remote view of SQLServer data?


Colin,
There could be another cursor instead of array that's inner joined. Or you could build a comma separated list of projids and use "in" :

SELECT * FROM Buildings WHERE ProjID in (&cCommaSepValue) INTO CURSOR cBuildings

SELECT * FROM Buildings WHERE ProjID in ('ID1', 'ID2') INTO CURSOR cBuildings

SELECT * FROM Buildings WHERE ProjID in (1023, 198) INTO CURSOR cBuildings

SQL server also allows things like this :

SELECT * FROM Buildings WHERE ProjID in (1023, 198, NULL) INTO CURSOR cBuildings

which correspond to :
where ProjID in (1023, 198) or is null

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
Next
Reply
Map
View

Click here to load this message in the networking platform