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 -> Re: calling methods in cursors

Re: calling methods in cursors

From: fumi <fumi_at_tpts5.seed.net.tw>
Date: Tue, 1 May 2001 22:22:54 +0800
Message-ID: <9cmk5r$doa$4@news.seed.net.tw>

"nilson" <jmcdonald_at_ucdavis.edu> ¼¶¼g©ó¶l¥ó news:9ciie9$2oj$1_at_woodrow.ucdavis.edu...
> I'm having a bit of a problem calling a method I created in a datatype
> inside my cursor statement. Let's say I create a print method for a
> datatype:

 [snip]
> cursor c1(efgh_name varchar2) is
> select nt.print() from table(select info from efgh where name = pname) l;
> ...
> begin
> ...
> for info_rec in c1(efgh_name) loop
> nested_table.EXTEND;
> nested_table(counter) := info_rec; -- here's where I get the error
> counter := counter + 1;
> end loop;
> ...
> END PR;
>
> I get an error at the -- comment above saying that expression is of wrong
> type, even though everything is in number type. Is this because methods
> can't be called within cursors? I tested the select statement etc. at the
> sql prompt and everything checked out.

No.
The datatype of the LHS is number, but the RHS is a record. It's obviously wrong datatype.

You should use a column alias in your cursor's SQL, then reference the column alias in the RHS.

By the way, notice your variable COUNTER is null, it seems you did't assign a value to it. Received on Tue May 01 2001 - 09:22:54 CDT

Original text of this message

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