Professional Documents
Culture Documents
Implicit cursors
Explicit cursors
Implicit cursors
Explicit cursors
Cursor Attributes
29-Apr-15
Cursor Attributes
Cursor Attributes
Attribute
Attribute
%FOUND
Return Value
TRUE, if the DML statements like INSERT,
DELETE and UPDATE affect at least one row
and SELECT .INTO statement return at
least one row.
FALSE, if DML statements like INSERT,
DELETE and UPDATE do not affect row and
SELECT.INTO statement do not return a
row.
Cursor Attributes
Attribute
Return Value
Creating a Cursor
Return Value
OPEN <cursor_name> ;
CLOSE <cursor_name>;
Example:
CURSOR
C1
SELECT
ENAME
IS
FROM
EMPLOYEE
WHERE
DESG='system_analyst';
29-Apr-15
LOOP
NAME:=ED.ENAME;
ID:=ED.EID;
DBMS_OUTPUT.PUT_LINE('NAME:'||NAME);
BIRDATE:=ED.BDATE;
DBMS_OUTPUT.PUT_LINE(NAME||ID||BIRDATE);
END LOOP;
END LOOP;
Lab Exercise
Category
Condition
Increment
Manager
Basic = + 10%
DA = + 2%; HR = + 3 %; CA = + 2%.
Manager
Basic = + 5% DA = + 1%; HR = + 1 %;
CA = + 1%.
Officer
Basic = + 5% DA = + 1%;
No Increment
Officer