Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Macro Expansion, and Name Expressions
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00243690
Message ID:
00243693
Vues:
24
First off, I would select into a cursor, not a table, if it is to be temporary. Since a cursor only exists for the current user (in memory if possible) then you can always name the cursor the same thing.

But if that isn't possible, then you'll need to do something like:

select * from mytable into table (lcForange)
select (lcForange)
* put my table code here

or

select * from mytable into table (lcForange)
use (lcForange) alias myalias

If you need to do another select, then you have to select from lcForange but you can still give that an alias:

select * from (lcForange) myalias where myalias.field = "somevalue"

something like that help you?

>I'm like *really* confused about macro expansions and name expressions. I start with the following code:
>
>
>* Grab a couple tempfile names
>
>lcFOrange= SUBSTR(SYS(2015), 3, 10) && taken from VFP help examples
>lcFExpend =SUBSTR(SYS(2015), 3, 10) && temp table name
>lcFCommit =SUBSTR(SYS(2015), 3, 10) && temp table name
>lcFOutput =SUBSTR(SYS(2015), 3, 10) && temp output file
>
>SELECT whatever into table (lcFExpend)
>
>
>This works, fine, but the (lcFExpend) then isn't a "real" alias that can be used to do things like
>
>
>WHERE (lcFExpend).fieldname="myvalue"
>
>
>I fooled around with all combinations of &lcFExpend and (lcFexpend) and sometimes things seem to work and other times not.
>
>I guess my global question is, how can I use a temporary file name that is randomly generated, for a table name within a program, and then be able to delete the file name. I'd like the name to be random; (it is a multi-user program). And I need to use this the same way I would use a normal table alias.
>
>Thanks.
>
>--- Larry
--Todd Sherman
-Wake Up! Smell the Coffee!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform