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 -> Re: In TOAD, how do I display refcursor results returned by an Oracle Store Procedure

Re: In TOAD, how do I display refcursor results returned by an Oracle Store Procedure

From: Eric Patrick <epatrick_at_quandis.com>
Date: 17 Sep 2004 07:50:19 -0700
Message-ID: <3c42f1ed.0409170650.59f77d5d@posting.google.com>


"paddy_nyr" <mpprpp_at_yahoo.com> wrote in message news:<2qu8f4F14cv2sU1_at_uni-berlin.de>...
> "Eric Patrick" <epatrick_at_quandis.com> wrote in message
> news:3c42f1ed.0409160927.25593c58_at_posting.google.com...
> > I am using TOAD, and I have a simple Oracle SP that returns a cursor:
> >
> > CREATE OR REPLACE PROCEDURE pObjectTypeList (
> > iObject nvarchar2,
> > oResult OUT Types.RefCursor
> > )
> > AS
> >
> > BEGIN
> > OPEN oResult FOR
> > SELECT
> > *
> > FROM ObjectType
> > WHERE
> > UPPER(ObjectType.Object) = UPPER(iObject)
> > END;
> >
> > I can execute it successfully in TOAD as follows:
> >
> > DECLARE
> > IOBJECT nvarchar2(200);
> > ISORTBY nvarchar2(200);
> > ORESULT Types.RefCursor;
> >
> > BEGIN
> > IOBJECT := 'LedgerTemplateItem';
> > ISORTBY := 'LedgerTemplateItem';
> > LOAN_MOD.POBJECTTYPELIST ( IOBJECT, ISORTBY, ORESULT );
> > COMMIT;
> > END;
> >
> > However, I cannot figure out how to display the contents of ORESULT in
> > TOAD. (The result set works beautifully in .NET using
> > System.Data.Oracle components.)
> >
> > Eric
> >
> I have tried a line after the commit statement with dbms_output.put_line (
> ORESULT); ?
I tried that, but get the following error:

PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'

I also tried put. I assume that neither method was designed to handle cursors? Received on Fri Sep 17 2004 - 09:50:19 CDT

Original text of this message

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