Table of Contents [Hide/Show]
Logic Flow for Explicit Cursors Cursors with Parameters FOR UPDATE Clause WHERE CURRENT OF Clause Cursor Attributes
CURSOR cursor_name IS select_statement;
INTO
ORDER BY
OPEN cursor_name;
FETCH cursor_name INTO [variable1, variable2, . . .] | [record_name];
FOR
FOR record_name IN cursor_name LOOP statements;END LOOP;
CLOSE cursor_name;
CURSOR cursor_name [(parameter_name datatype, . . .)] IS select_statement;
DECLARE CURSOR emp_cursor (p_deptno NUMBER, p_job VARCHAR2) IS SELECT empno, ename FROM emp WHERE deptno = p_deptno AND job = p_job; BEGIN OPEN emp_cursor(10, 'CLERK'); . . .
SELECT . . . FROM . . . ORDER BY . . . FOR UPDATE [OF column_reference [, column_reference]] [NOWAIT];
FOR UPDATE
NOWAIT
WHERE CURRENT OF cursor;
DECLARE CURSOR sal_cursor IS SELECT sal FROM emp WHERE deptno = 30 FOR UPDATE OF sal NOWAIT; BEGIN FOR emp_record IN sal_cursor LOOP UPDATE emp SET sal = emp_record.sal * 1.10 WHERE CURRENT OF sal_cursor; END LOOP; COMMIT; END;
SQL%ROWCOUNT
SQL%FOUND
TRUE
SQL%NOTFOUND
SQL%ISOPEN
FALSE
ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.