| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> PL/SQL function core dumps when returning un-assigned REF CURSOR variable
I have a PL/SQL function in a stored package that returns a REF CURSOR
variable. I've noticed that if I attempt to return from the function before
opening the cursor (which I want to do if for example the parameters to the
function are not acceptable), my session aborts with a core dump. (8.0.5
under Solaris 2.6).
My question is: What should I in fact return from the function to indicate the equivalent of a 'no rows found' result?. I have tried to find the answer in the manuals, honest.
The relevant declarations are roughly as below:
... in the package spec ...
TYPE rec_typ IS RECORD ( c1 my_table.col_1%TYPE , c2 my_table.col_2%TYPE ) ; TYPE refcur_typ IS REF CURSOR RETURN rec_typ ;
... in the package body ...
FUNCTION my_func ( my_parameter IN VARCHAR2 ) RETURN refcur_typ IS
my_cursor refcur_typ ;
BEGIN
RETURN ( my_cursor ) ; /*- Session core dump here */
END
Grateful for any suggestions.
Adrian Bowen Received on Mon Aug 16 1999 - 11:54:01 CDT
![]() |
![]() |