Archives of the TeradataForum
Message Posted: Fri, 12 Sep 2003 @ 13:59:18 GMT
Subj: | | Re: Stored Procedure parms |
|
From: | | Gorrella, Srini |
Narayan - you can pass either Database or Table name into Stored procs
Paul - Yes you can pass the COLUMN or DATABASE names but the stored proc you need to create must be dynamic , these stored proc shld
reside in USER database ONLY .
replace procedure sg7974.sysexec
(
IN tablename VARCHAR(30),
IN dbname VARCHAR(30)
)
begin
declare strSQL VARCHAR(1000);
declare str VARCHAR(100);
set str = dabname||'.'||tablename;
set strSQL = 'CREATE TABLE SG7974.DYNAMIC AS '||str||' WITH NO DATA;' ;
CALL DBC.SysExecSQL(:strSQL);
end;
Let me know if you have any questions
Thanks,
Srini
|