Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameterized IN (cList) clause in SQL
Message
From
08/05/1999 00:24:35
 
 
To
07/05/1999 22:57:02
George Simon
GS Data Technologies, LLC
Cincinnati, Ohio, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00216334
Message ID:
00216341
Views:
26
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform