Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parameterized IN (cList) clause in SQL
Message
De
08/05/1999 00:24:35
 
 
À
07/05/1999 22:57:02
George Simon
GS Data Technologies, LLC
Cincinnati, Ohio, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00216334
Message ID:
00216341
Vues:
27
Hi George!

The following will work:

Replace: WHERE state IN ( ?vp_StateList )
With: WHERE state $ ?vp_StateList


>
>I am trying to create a view where the IN list is parameterized. For example, in this view the states are hard coded into the SQL statement:
>
>CREATE SQL VIEW lv_Sample AS ;
>SELECT lname, fname, customerid ;
>FROM test!customer ;
>WHERE state IN ('NY','PA','CA')
>
>I want to be able to pass a dynamic list as a parameter. Something like this:
>
>CREATE SQL VIEW lv_Sample AS ;
>SELECT lname, fname, customerid ;
>FROM test!customer ;
>WHERE state IN ( ?vp_StateList )
>
>vp_StateList = "'NY','PA','CA'"
>REQUERY('lv_Sample')
>
>vp_StateList = "'MA','OH','FL'"
>REQUERY('lv_Sample')
>
>
>How do I do this?
>
>TIA
>
>George
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform