Mike Yearwood
Toronto, Ontario, Canada
Information générale
Catégorie:
Conférences & événements
>We have several routines/quirks that are prsent in our company coding standards.
>
>
>BAsically all tables are aliased into variable so they can be changed in one place in each method/function.
>
>All of our scans are run around variables containing alias names:
>
>lcAlias = 'Table'
>...
>...
>...SELECT &lcAlias
However, if 'Table' was Customer.DBF the code that refers to lcAlias now becomes less readable. You could get the very same effect without the need for any evaluation or macrosubstitution using the USE command itself. If the table name changed, you would just change the USE line. CustomerAlias would be an unlikely change as the method should be dealing with Customers - in this example.
USE Table ALIAS CustomerAlias
select CustomerAlias
scan
If the routine was more generic, such as it was updating a table with some values you could...
USE Table alias TargetTable
SELECT TargetTable
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement