create or replace function fn_getbelongsCodeByCategory01(p_eventcategory in varchar2)
return varchar2 is
begin
declare
L_tmp varchar2(32766);
L_Result varchar2(32766);
--定義游標(biāo)
cursor cur is
select t.innercode
from vw_commontype t
start with id = p_eventcategory
connect by prior id = parentid
group by t.innercode;
begin
--遍歷游標(biāo)
FOR tab IN cur
loop --遍歷
L_tmp := tab.innercode;
if (L_tmp is not null and L_Result is null) then
L_Result := '''' || L_tmp||'''';
else
L_Result := L_Result||',''' || L_tmp||'''';
end if;
end loop;
return L_Result;
--異常處理
EXCEPTION
WHEN NO_DATA_FOUND THEN
RETURN NULL;
end;
end;
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請
點(diǎn)擊舉報(bào)。