Professional Documents
Culture Documents
Implicit Cursor : It invokes automatically for insert, update and delete statements
and even it invokes for select statement , if it returns only one record
Explicit Cursor : It is required to retrieve more than one record by using select
statement from database table.
Cursor Declaration
Syntax : cursor <cursorname> is select,......
eg: cursor ec is select * from emp;
Fetch Cursor
Syntax : fetch <cursorname> into <cursorvariable>;
eg: fetch ec into v_ec;
Close Cursor
Syntax : close <cursorname>;
eg: close ec;
Cursor Attributes
%isopen : It returns true if cursor is already opened otherwise false.
Syntax : <cursorname>%isopen
%notfound : It return true if the record not found to fetch otherwise false
Syntax : <cursorname>%notfound