Archives of the TeradataForum
Message Posted: Wed, 08 Aug 2007 @ 09:37:27 GMT
Subj: | | Re: Create table in a Macro |
|
From: | | McCall, Glenn David |
Did/Can you try using a procedure?
Here is an example based upon dbc.dbcinfo.
replace procedure t (in param varchar(10))
begin
CALL DBC.SysExecSQL ('create table dbcinfo_copy as (
select *
from dbc.dbcinfo
where infokey = ''' || :param || '''
)
with data;'
); /* This is the end of the call DBC.SysExecSQL */
end;
I will let you rework it for your query. Obviously you can only run this once - unless you drop the table you just created. You could put
the drop in the procedure call as well just to be safe.
Glenn Mc
|