Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: calling methods in cursors
I thought that the RHS would be the datatype that the method nt.print() returns, not a record. How can I use a column alias on a method? I'm still getting the hang of objects, thanks for the help.
Jeff
"fumi" <fumi_at_tpts5.seed.net.tw> wrote in message
news:9cmk5r$doa$4_at_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 - 13:07:08 CDT
![]() |
![]() |