-
I have a package and in the package specification , I define a reference cursor type and in the package body I will use define a reference cursor variable based on this reference cursor type and open it .
My question is : Do I need to initialize it everytime in the beginning of package body and How to initialize is reference cursor variable ?
-
You need not to initialize it at all.
You can use it directly in following way.
DECLARE c1 YOUR_PACKAGE.YOUR_REF_CUR_TYPE;
BEGIN
...
OPEN c1 FOR ...
...
END;
Please correct me if I am wrong.
-
I would agree with you if it is inside a function . I think package is different story .