Is it possible to make a selection directly in the hierarchical user type?
Imagine a table structure like this:
PARENT
ID
NAME
CHILD
ID
PARENT_ID
NAME
In addition, I have user types such as:
create or replace type child_item as object
(
ID NUMBER(10),
NAME VARCHAR(255)
);
create or replace type children_table as table of child_item;
create or replace type parent_item as object
(
ID NUMBER(10),
NAME VARCHAR(255),
CHILDREN CHILDREN_TABLE
);
create or replace type parent_table as table of parent_item;
And an expression like this:
select * from parent p inner join child c on p.id = c.parent_id;
Now I want the result of this statement to be in a type object parent_table. Is this possible without using a complex loop FOR?
source
share