Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameterized view with a parameter that has multiple va
Message
 
 
To
19/03/1999 15:55:07
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00199968
Message ID:
00199996
Views:
18
>Hi!
>
>I have some remote data.
>
>I also have a program that allows users to go thru the main customer table and pick the people they want to work on. When that program is done, I am left with a cursor that contains the customer key.
>
>I now want to select from a few remote child tables the matching records. Parameteritized views seem the way to go.
>
>I need something like:
>
>
>CREATE SQL VIEW MYVIEW1 FROM REMOTE CONNECTION MYCONN AS ;
>SELECT * FROM CHILD1 WHERE CUSTKEY IN (SELECT CUSTKEY FROM MYCURSOR)
>
>
>Will that work?
>
>Thanks for your help, have a GREAT weekend all!

Your SQL is correct, but the problem you willl have is that the source of the subquery has to be the same as the CHILD1 table (i.e., MYCURSOR actually has to be in the same place as CHILD1). So you need a different approach. In VFP, the syntax would be something like:

select * from child1 where inlist(CustKey, val1, val2, val3, ..., valx)

Or, in Oracle [and probably SQL Server]:

select * from child1 where CustKey in (val1, val2, val3, ..., valx)
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform