Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parameterized view with a parameter that has multiple va
Message
 
 
À
19/03/1999 15:55:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00199968
Message ID:
00199996
Vues:
20
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform