Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sql fields
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00567830
Message ID:
00567837
Vues:
15
This message has been marked as the solution to the initial question of the thread.
You have to use macro substitution in this case
lcFieldname = "firstanme"
lcSomeVar = "a"
select &lcFieldname ;
  from testdata ;
  where &lcFieldname == lcSomeVar ;
  into cursor test 
>how can I make a field that I want pick in sql statement generic. For example I can write the following sql statements
>
>select firstname from testdata into cursor test where firstname == a
>select lastname from testdata into cursor test where lastname == b
>select address from testdata into cursor test where address == c
>
>how can I make it so that the selection fields can substituted with a variable? for example
>
>select fieldname from testdata into cursor test where fieldname == somevariable
>
>I want to be able to choose my own fieldnames.
>
>Thanks
>Nick Patel
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform