入参为变量,循环调用
DECLARE
cursor CUR_PLY_NO is
SELECT C_PLY_NO FROM ZSSYS.WEB_GBDJ_INFO_SUB;
BEGIN
FOR LR_PLY_NO IN CUR_PLY_NO LOOP
PK_TOOL.P_IMPORT_OL_DATA(LR_PLY_NO.C_PLY_NO);
COMMIT;
END LOOP;
END;
以存储过程名字为变量调用
DECLARE
VSQL VARCHAR2(200);
I_PROC USER_TABLES.TABLE_NAME%TYPE;
CURSOR YB IS
SELECT OBJECT_NAME
FROM USER_PROCEDURES
WHERE OBJECT_NAME LIKE 'PROC%'
AND OBJECT_NAME NOT LIKE 'PROC_ERR_LOG%'
AND OBJECT_NAME NOT LIKE 'PROC_TAB%';
BEGIN
I_PROC := 'PROC_FMS_ACCENTRY2_HL';
OPEN YB;
LOOP
FETCH YB
INTO I_PROC;
EXIT WHEN YB%NOTFOUND;
VSQL := 'BEGIN ' || I_PROC || '(DATE''2018-03-01''); END;';
EXECUTE IMMEDIATE VSQL;
END LOOP;
END;