Types of cursor variable.
0
Types of cursor variable:
There are two types of Ref Cursor.
Step-1:
Type <type name> is ref cursor;
Step-2:
<cursor variable name> <type name>;
Step-3:
Open<cursor variable name>
for(select statement);
fetch
exit
close;
Strong cursor variable:
Step-1:
Type <type name> is ref cursor
RETURN record_type;
Step-2:
<cursor variable name> <type name>;
Step-3:
Open<cursor variable name>
for(select statement);
fetch
exit
close;
There are two types of Ref Cursor.
- Weak cursor variable or Weak Ref Cursor
- If we do not include a RETURN clause in the Cursor, then it is a weak REF Cursor.
- Cursor variables declared from weak REF cursors can be associated with any query at runtime.
Step-1:
Type <type name> is ref cursor;
Step-2:
<cursor variable name> <type name>;
Step-3:
Open<cursor variable name>
for(select statement);
fetch
exit
close;
Strong cursor variable:
- A REF CURSOR with a RETUN clause define a “Strong” REF CURSOR.
Step-1:
Type <type name> is ref cursor
RETURN record_type;
Step-2:
<cursor variable name> <type name>;
Step-3:
Open<cursor variable name>
for(select statement);
fetch
exit
close;
0 comments: