Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create or replace function find_object_level(obj_x VARCHAR2)
- RETURN number as lvl_object number;
- begin
- SELECT level
- into lvl_object
- from objects
- where name = obj_x
- START WITH parent_id is null
- CONNECT BY PRIOR object_id = parent_id;
- return lvl_object;
- end;
- select find_object_level(name) from objects where name = 'Томас Шелби'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement