Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 12 Sep 2003 @ 13:59:18 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


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



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023