日期:2014-05-17 浏览次数:20738 次
EXECUTE IMMEDIATE OPT_VALUE.PROCEDURE_NAME; --改为 EXECUTE IMMEDIATE 'begin '||OPT_VALUE.PROCEDURE_NAME||'; end;';
------解决方案--------------------
EXECUTE IMMEDIATE OPT_VALUE.PROCEDURE_NAME;
应该为
EXECUTE IMMEDIATE 'call '||OPT_VALUE.PROCEDURE_NAME||'()';
------解决方案--------------------
CREATE OR REPLACE PROCEDURE SP_LINJIE1 IS
CURSOR CUR_OPT IS
SELECT TB_NAME, STATE, T.STATE2, T.PROCEDURE_NAME FROM V_GRSOURCEVST T;
OPT_VALUE CUR_OPT%ROWTYPE;
vi_out pls_integer;
BEGIN
OPEN CUR_OPT;
LOOP
FETCH CUR_OPT
INTO OPT_VALUE;
EXECUTE IMMEDIATE 'begin '|| OPT_VALUE.PROCEDURE_NAME ||'(:1); end;' using out :vi_out;
EXIT WHEN CUR_OPT%NOTFOUND;
END LOOP;
CLOSE CUR_OPT;
END;