首页 > 代码库 > [oracle] 递归追溯完整部门名称 函数

[oracle] 递归追溯完整部门名称 函数

 

create or replace function fn_DeptWholeName2(objectid in number)
return nvarchar2 is
wholename nvarchar2(500);

begin
select to_char(replace(wm_concat(OBJNAME),‘,‘,‘.‘))a into wholename from (
select * from v_organddept2 o
start with o.objid=objectid
connect by prior o.ParentID=o.OBJID
order by o.levelid )a;

return wholename;
end fn_DeptWholeName2;

[oracle] 递归追溯完整部门名称 函数