Archives of the TeradataForum
Message Posted: Tue, 30 Jul 2002 @ 14:33:39 GMT
I think you will get a lot of response that a stored procedure will work for you. This does what you are asking for but not how you asked. There are two assumptions:
Your source comes from a finite number of tables.
The tables will always exist. (I assume the macro will fail if one does not exist at any point) It doesn't matter what state the table is in, it just needs to exist.
I am borrowing this from a select macro and it works fine. I hope the same holds true for insert/select. I don't have time to test it. This macro would allow you to call it in any of these ways:
exec insert_macro('T1'); will insert using T1 as the source.
CREATE MACRO DB.Insert_Macro
|Copyright 2016 - All Rights Reserved|
|Last Modified: 28 Jun 2020|