Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
IN clause in Parameterized views
Message
De
01/04/1999 11:26:36
 
 
À
01/04/1999 11:21:33
Bruce Gilmour
Cal-Mour Consultants
Calgary, Alberta, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00204282
Message ID:
00204287
Vues:
17
>Now I freely admit I may have missed something on this in the past but here goes anyway.
>
>I want to create a view that contains only certain records (eg- from an order file containing orders 1 through 15 I want to print 3, 6, 7, 9, 12 where the order number is a character field). I figured the easiest way was a parameterized view that contained a clause such as "WHERE ordernumber IN ?mylist". It doesn't work. Depending on the makeup of the list stored in the mylist variable, it usually only selects the first item in the list. I have tried storing the following strings to mylist:-
>
> " 3"," 6"," 7"
> (" 3"," 6"," 7")
> 3"," 6"," 7
> as well as any other variation I could think of. That last one was in case quotes were automatically being put around my string when it was passed. I am using VFP 5.0. Does this work in 6.0 or is it not supposed to work in the first place? I would prefer to use a parameterized view instead of creating a custom view in my code but I am open to suggestions.
>
>Also how do other people handle or reccomend handling the need to print a random list of things (such as orders) where the data comes from multiple files?
>
>TIA

You may create cursor:
cMystring="('23','48')"
Select * From mytable Where myfield IN &cMystring. Into Cursor tmp Nofilter
and print from this cursor
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform