Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Assigning a record to a ref cursor?
In article <959dj2$hf4$1_at_nnrp1.deja.com>,
sandlinm_at_my-deja.com wrote:
> My code is below.. I am basically trying to a assing a variable of
> record type '%rowtype' to a cursor.. I don't really know how to do
> it..Anybody have any Ideas..??
>
> Thanks
> (Look for the >>>>>>'s)
> ----------------------------------------------------------------------
--
> PROCEDURE FETCH_ERROR (ERROR_ID# IN NUMBER, IO_CURSOR IN OUT
RET_CURSOR)
> IS
> ERROR_CURSOR RET_CURSOR;
> ERROR_REC TBLPESPERROR%ROWTYPE;
>
> BEGIN
> IF LENGTH(ERROR_ID#) != NULL THEN
> OPEN ERROR_CURSOR FOR
> SELECT * FROM TBLPESPERROR WHERE ERROR_ID = ERROR_ID#;
> ELSE
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> >>Beginning of problem
> >>THIS is where I want to return my own data.. in the form of a
> >>ref cursor.. the code that exists is what I tried.. that didn't work
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> OPEN ERROR_CURSOR FOR
> ERROR_REC.ERROR_ID := 0;
> ERROR_REC.SQL_CODE := -999;
> ERROR_REC.SQL_ERRM := 'No ERROR_ID was sent to the
> procedure FETCH_ERROR';
> ERROR_REC.CURRDATETIME := SYSDATE;
>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> >>End of problem
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> END IF;
> IO_CURSOR := ERROR_CURSOR;
> END FETCH_ERROR;
> END PACK_ERRORS;
>
> Sent via Deja.com
> http://www.deja.com/
>
Hi,
Regarding ref cursors I've had great benefit of this article: http://osi.oracle.com/wa/ask/owa/ask_tom_pkg.display? p_dispid=1288401763279
Hope this can inspire you too.
/Michael
Sent via Deja.com
http://www.deja.com/
Received on Thu Feb 01 2001 - 03:46:53 CST