Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> calling methods in cursors
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:
create type abcd as object(
attribute1 number,
attribute2 number,
member function print return number,
pragma ...
);
create type body abcd as
member function print return number is
BEGIN
...
END;
END;
create type abcdlist as table of abcd;
create table efgh (
name varchar2,
info abcdlist)
nested table info store as info_tab;
then I create a pl/sql procedure with a cursor in it that stores the number result of the print member function in type abcd for each of the nested info tuples in efgh:
create procedure pr(efgh_name) is
...
info_rec number;
counter number;
type num_type is table of number;
nested_table num_type := num_type();
...
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 errorcounter := counter + 1;
Thanks,
Jeff Received on Sun Apr 29 2001 - 21:30:56 CDT
![]() |
![]() |