[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)