Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using variables in SELECT command
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00114850
Message ID:
00114869
Views:
15
>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 ------------
Previous
Reply
Map
View

Click here to load this message in the networking platform