|
|
Archives of the TeradataForum
Message Posted: Wed, 30 Mar 2005 @ 13:55:41 GMT
Subj: | | Re: Handling common SQL blocks in a Stored Proc |
|
From: | | Geoffrey Rommel |
| (In each case, the stored proc is one SQL call that uses derived tables at several spots.) | |
If the procedure is really just one SQL statement, it could be coded as a macro. Broadly speaking, I would prefer views to macros and macros to
stored procedures.
| We would like to simplify the maintenance and add some structure to the SQL. One suggestion is to capture the calls against the
derived tables in views which would then be invoked by the stored proc. | |
Sounds good. Anything that makes the SQL easier to read is a good idea.
| |