Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macro substitution and evaluate - which to use
Message
 
 
To
19/07/2007 13:45:16
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01241954
Message ID:
01242090
Views:
19
The name expression will not work for '(laTmp[1])' because it's expression not a name.
SELECT EVALUATE(laTmp[1]) AS (lcNewField) ;
  FROM (lcOldFile) ;
  INTO TABLE lcNewFile DATABASE (lcTableDBC)
>In this case, neither EVAL() nor a macro is needed for most of what you're doing. Name substitution will do:
>
>
>SELECT (laTmp[1]) AS (lcNewField) ;
>  FROM (lcOldFile) ;
>  INTO TABLE lcNewFile DATABASE (lcTableDBC)
>
>
>I'm not 100% sure name substition works for the AS, but everywhere it will.
>
>Although most of the others recommend textmerge, I wouldn't bother in this case where name subsitution is enough. I find it much easier to read code that contains the actual SQL command than code that builds a string and executes it. While I haven't tested, I see no reason why this version would be slower.
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform