修改游标所在的表

DECLARE
v_header_id NUMBER;
CURSOR cur_part_list IS
SELECT *
 FROM ske_sys_part_list
FOR UPDATE NOWAIT;
BEGIN
FOR rec_part IN cur_part_list
LOOP
SELECT ske_sys_part_list_s.nextval
 INTO v_header_id
 FROM dual;
IF rec_part.header_id IS NULL THEN
UPDATE ske_sys_part_list
SET header_id = v_header_id
WHERE CURRENT OF cur_part_list;
END IF;
END LOOP;
--COMMIT;
END;
posted @ 2011-08-14 23:20  郭振斌  阅读(298)  评论(0编辑  收藏  举报