Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using variables in SELECT command
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00114850
Message ID:
00114869
Vues:
13
>Hi Mandy,
>
>yet another approach is this
>create an array with the tables. Call it laTables
>create an array with the agencys. Call it laAgencys
>Store the tables and the agencys in the arrays (use SQL to store them)
>
>run this code
>
>for ix=1 to alen(laAgencys)
>lcCommand="SELECT * FROM lcMytable INTO TABLE c:\mainwork\lcAgency\lcMytable WHERE acode=lcAgency"
>lcCommand=strtran(lcCommand,"lcAgency",alltrim(laAgencys[i]))
>for iz=1 to alen(laTables)
>lcCommand=strtran(lcCommand,"lcMyTable",alltrim(laTables[i]))
>&lcCommand
>endfor
>endfor
>
>/Pierre Unge, Sweden

Sholud be
>for ix=1 to alen(laAgencys)
>lcCommand="SELECT * FROM lcMytable INTO TABLE c:\mainwork\lcAgency\lcMytable WHERE acode=lcAgency"
>lcCommand=strtran(lcCommand,"lcAgency",alltrim(laAgencys[ix]))
>for iz=1 to alen(laTables)
>lcCommand=strtran(lcCommand,"lcMyTable",alltrim(laTables[iz]))
>&lcCommand
>endfor
>endfor
------------- if you cut here, you'll probably destroy your monitor ------------
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform