Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Macro substitution and evaluate - which to use
Message
 
 
À
19/07/2007 13:45:16
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01241954
Message ID:
01242090
Vues:
21
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--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform