create or replace function F_STAND_LEAVEL_TREE2LIST(childcode in varchar2) return varchar2 is
Result varchar2(500);
begin
select
substr(replace(wmsys.wm_concat(stand_leavel_name),',','>>'),INSTR(replace(wmsys.wm_concat(stand_leavel_name),',','>>'),'>>')+2)
into Result
--replace(wmsys.wm_concat(stand_leavel_name),',','>>')
from (
select rownum as xh,stand_leavel_name
from t_lm_bas_stand_leavel
start WITH code=childcode
connect by prior parent_leavel_code=code
order by rownum desc
) t;
return(Result);
end F_STAND_LEAVEL_TREE2LIST;
Result varchar2(500);
begin
select
substr(replace(wmsys.wm_concat(stand_leavel_name),',','>>'),INSTR(replace(wmsys.wm_concat(stand_leavel_name),',','>>'),'>>')+2)
into Result
--replace(wmsys.wm_concat(stand_leavel_name),',','>>')
from (
select rownum as xh,stand_leavel_name
from t_lm_bas_stand_leavel
start WITH code=childcode
connect by prior parent_leavel_code=code
order by rownum desc
) t;
return(Result);
end F_STAND_LEAVEL_TREE2LIST;