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

Home -> Community -> Usenet -> c.d.o.tools -> Assigning a record to a ref cursor?

Assigning a record to a ref cursor?

From: <sandlinm_at_my-deja.com>
Date: Wed, 31 Jan 2001 16:13:32 GMT
Message-ID: <959dj2$hf4$1@nnrp1.deja.com>

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/ Received on Wed Jan 31 2001 - 10:13:32 CST

Original text of this message

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