set serveroutput on
DECLARE
x NUMBER;
CURSOR cursor_mp IS
SELECT * FROM STUDENT
where 1=1
AND SUJ = '1111';
record_mp cursor_mp%ROWTYPE;
BEGIN
x := 0;
FOR record_mp IN cursor_mp LOOP
UPDATE STLD
SET CRE = record_mp.cre
WHERE SUJ = record_mp.suj
x := x+1;
/*
DBMS_OUTPUT.PUT_LINE(record_mp.cre);
DBMS_OUTPUT.PUT_LINE(record_mp.suj);
DBMS_OUTPUT.PUT_LINE(' ---- ');
*/
END LOOP;
DBMS_OUTPUT.PUT_LINE('완료건수 => ' || x);
commit;
END;
/
'DataBase > PLSql' 카테고리의 다른 글
[PL/Sql] PL/Sql 트리거 (Trigger) (0) | 2012.08.13 |
---|---|
[PL/Sql] PL/Sql 대용량 오브젝트 타입 - BFILE (0) | 2012.08.13 |
[PL/Sql] PL/Sql 대용량 오브젝트 타입 - CLOB, BLOB (0) | 2012.08.13 |
[PL/Sql] PL/Sql 커서(cursor) FOR UPDATE 절 (0) | 2012.08.13 |
[PL/Sql] PL/Sql 커서(cursor) (0) | 2012.08.13 |