Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> PL/SQL function core dumps when returning un-assigned REF CURSOR variable

PL/SQL function core dumps when returning un-assigned REF CURSOR variable

From: Adrian Bowen <adrian_at_raptor.win-uk.net>
Date: Mon, 16 Aug 1999 17:54:01 +0100
Message-ID: <7p9fts$44e$1@laura.pcug.co.uk>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US