在Teradata中创建主SP,以动态调用其他SP

时间:2019-06-27 11:36:06

标签: sql teradata

REPLACE  PROCEDURE PD_CCP_FN_DB.master_proc_TEST()
SQL SECURITY INVOKER
BEGIN
DECLARE STMT VARCHAR(4000);
    FOR rec AS Cur CURSOR FOR 
       select SP_NAME from  WRK_QA_CCP_ATOMIC_DB.SP_CALL
     DO
       SET STMT= ' CALL ' || rec.SP_NAME || '(''PII_SUPP_SMRY_TXN'') ';
       EXECUTE IMMEDIATE STMT;
     END FOR;
END;

0 个答案:

没有答案