Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create or replace function find_parents_childs(obj_x VARCHAR2)
- RETURN objects_below as parents objects_below;
- begin
- select LPAD(' ', 3*level)||name
- bulk collect into parents
- from objects start WITH object_id = (SELECT object_id from objects
- where name = obj_x)
- CONNECT by prior parent_id = object_id;
- return parents;
- end;
- select find_parents_childs(name) from objects where name = 'Томас Шелби'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement