We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1
Ref cursor:
Ref cursor is variable defined as cursor type, refcursor point or reference to
cursor result set.
Advantage: ref cursor can passed as variable to pl/SQL function or procedure.
The ref cursor can be assigned to another ref cursor varaible. The powerful capability of ref cusror is can open the curosr in one block, then passed to antoher block for processing and the return to main black for closing. The cusror variable can also returned by a function and assigned to antoher variables
Types of ref cursors:
-------------------- 1.Strong ref cursor:By strongly typing the cursor variable, you define what the cursor can return. If a strongly typed cursor returns something other that its return type, a ROWTYPE_MISMATCH exception is raised. A strongly typed cursor type is less flexible but less prone to programming errors.
Ex: type type_name as ref cursor
retun type_name%rowtype 2.weak ref cursor: This REF CURSOR is a weak typed cursor variable because it does not define the datatype the cursor will return.