Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using a class property when building an SQL statement
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00291715
Message ID:
00291720
Vues:
21
>I am trying to use a class property as the where clause in an SQL statement. Something like...
>
>********
>class property
> myclass.property = "mytable.field = 'Georgia'"
>*******************
>
>select * ;
> from mytable;
> where myclass.property
>
>I have tried to use the & and eval() but I either get a syntax error with the & and 0 records with eval. Eval() always equals .f. in the command window.
>
>I know I can assign a variable the contents of the class property and then macro it in the where clause, but was just wondering if I was overlooking something.
>
>thanks,
>Ron

The following has worked for me:

cString = myclass.property
select * from mytable where &cString
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform