标签:com roc proc 死循环 from row 收集 nic into
CREATE OR REPLACE PROCEDURE SP_DM_OUTPAT_FEE_DOC_D_3 AS
CURSOR cur IS
SELECT *
FROM CDINFO.CLINIC_CLASS_DICT@zyhdc236;
TYPE rec IS TABLE OF CDINFO.CLINIC_CLASS_DICT@zyhdc236%ROWTYPE;
recs rec; -- --- 声明需要集合类型及变量,参照字段的 type 来声明类型
BEGIN
OPEN cur;
WHILE (TRUE) LOOP
FETCH cur BULK COLLECT ---游标逐行获取,按块收集
INTO recs LIMIT 100; ----recs 相当于一个容器
FORALL i IN 1 .. recs.COUNT --遍历集合
INSERT INTO CDINFO.CLINIC_CLASS_DICT VALUES recs (i);---i表示所有行数
COMMIT;
EXIT WHEN cur%NOTFOUND; ----没找到数据退出 ,否则死循环
END LOOP;
CLOSE cur;
END;
标签:com roc proc 死循环 from row 收集 nic into
原文地址:https://www.cnblogs.com/singworld/p/12206955.html