I am trying to access the child variable of the object through the parent
declare
i a22;
i1 VARCHAR(10);
begin
i := a22('a22', t_b1(
b22('b22', t_a1(a22('a22_2', t_b1(b22('b22_2', t_a1())))))
)
);
dbms_output.put_line('i.name_a1='||i.name_a1);
dbms_output.put_line('i.t_b1(1).name_b1='||i.o_b(1).name_b1);
dbms_output.put_line('i.o_b(1).o_a(1).name_a1='||i.o_b(1).o_a(1).name_a1);
end;
/
When compiling, an error occurs indicating that the variable needs to be declared. It is logical that the parent does not know about the variables of the child object. But when initializing everything successfully. How can I access a child variable?
The objects themselves:
Create type a1 is object (
name_a1 varchar2(10)
) NOT FINAL NOT INSTANTIABLE;
Create type b1 is object (
name_b1 varchar2(10)
) NOT FINAL NOT INSTANTIABLE;
create type t_a1 is table of a1;
create type t_b1 is table of b1;
Create type b22 UNDER b1 (
o_a t_a1
) INSTANTIABLE;
Create type a22 UNDER a1 (
o_b t_b1
) INSTANTIABLE;