[oracle入門]カーソルを利用するサンプル
1.暗示カーソル
BEGIN DELETE FROM MEMBERTBL WHERE CFT_NO = 110; DBMS_OUTPUT.PUT_LINE(SQL%ROWCOUNT); END;
2.明示カーソル
DECLARE CURSOR ADDRESS_CURSON IS SELECT ADDRMEMO,ADDRNAME FROM MEMBERTBL WHERE CFT_NO = 110; BEGIN FOR CFT_RR IN ADDRESS_CURSON LOOP EXIT WHEN ADDRESS_CURSON%NOTFOUND; DBMS_OUTPUT.PUT_LINE(ADDRESS_CURSON%ROWCOUNT); END LOOP; END;