Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: pl/sql refcursor
Ken Chesak wrote:
> When working correctly the procedure will return 1 unit and 1 bjn.
> That is no problem. However it is possible to have bad data where
> there would be multiple records returned on the first select. I was
> hoping to return those error values. The refcursor will certainly
> capture those but I was unable to determine if there was more than 1
> value, hence the array. The array information is exactly what I
> want, but there is no array variable in sqlplus, so I cant test. I
> was trying to take that last step an put it in a refcursor.
>
> I am new to Oracle and would appreciate any constructive suggestions.
A simple SELECT COUNT will tell you if there is more than one record. If there is you could handle it with an error message parameter (ei VARCHAR2) that you return. Or you could just use a REF CURSOR right from the start and return that.
But also check this out as it may be of interest: http://tahiti.oracle.com/pls/tahiti/tahiti.drilldown?word=ARRAY&verb=Returning&expand_all=1&remark=Verb+hint
Daniel Morgan Received on Thu Jun 20 2002 - 11:17:31 CDT