Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create or replace function find_first_childs (obj_x VARCHAR2)
- return objects_below as first_childs objects_below;
- begin
- select LPAD(' ', 5*level)||objects.name
- BULK COLLECT into first_childs
- FROM objects JOIN object_types USING (object_type_id)
- where level < (
- select level from objects where name = obj_x
- start with parent_id is null CONNECT by prior object_id = parent_id
- ) + 1
- START WITH objects.name = obj_x
- CONNECT by prior objects.object_id = objects.parent_id;
- return first_childs;
- end;
- select * from find_first_childs('ін-94-1');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement