Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parameterized Views.
Message
 
 
À
18/05/2001 12:35:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00508811
Message ID:
00508824
Vues:
28
Hi!

"?" works for a single value only. Use other approaches:
1. Use WHERE Field IN (SELECT ...)
2. Use WHERE Field IN (List Of Values)
3. Create view on the fly using & (macro). this way you can build 1. or 2. query easy. Or even like following:
str=[CREATE SQL VIEW tranmemo remote connection novtrans as SELECT * FROM tranmemo ;
WHERE ssFno = '73827282' OR ssFno = '7627272' OR ssFno = '8745949' OR ssFno = '7376478']
&str

You can use also SQLEXEC function and similar (SQL Pass Through) to send a query to server directly.


>I have created a view and it works fine when I use one string as the variable Ex:
>
>PASS1: Works Fine
>lcPendCds = '73827282'
>CREATE SQL VIEW tranmemo remote connection novtrans as SELECT * FROM tranmemo ;
> WHERE ssFno = ?lcPendCds
>
>When I add a few more parameters:
>
>Pass2:
>lcPendCds = " '73827282' OR '7627272' OR '8745949' OR '7376478' "
>CREATE SQL VIEW tranmemo remote connection novtrans as SELECT * FROM tranmemo ;
> WHERE ssFno = ?lcPendCds
>
>The second pass blows up. Is there a why pass all of these parameters?
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform