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:
00508823
Vues:
25
>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?

William,
VFP (or any programming language that I know) doesn't know what to with ORs. You must restate what you are comparing to. You could build the entire clause dynmically. Ex.
Pass2:
lcPendCds = "ssFno ='73827282' OR ssFno ='7627272' OR ssFno ='8745949' OR ssFno ='7376478'"
CREATE SQL VIEW tranmemo remote connection novtrans as SELECT * FROM tranmemo ;
   WHERE &lcPendCds
HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform