Académique Documents
Professionnel Documents
Culture Documents
varchar2,type in varchar2)
return varchar2
is
--
/*--------------------------------------------------------------------------------
--------------------------*/
--/*--created by : venkatesan s
--------------------------------------------------------------------*/
--/*--datelastmodified : 02-mar-2008
---------------------------------------------------------------------*/
--/*--purpose : to extract the servicegroup_id ,hub and headend from
the servicegroup field ----*/
--/* given in the source file as in combined format
----------------------------------*/
--/* the delimiter used to split the data is '.' (dot)
-------------------------------*/
--/*--version : 1.0
-----------------------------------------------------------------------------*/
--/*--sample : select func_splitservicehubheadend
('abcd.def.ghi','headend') from dual;---------*/
--
/*--------------------------------------------------------------------------------
--------------------------*/
begin
--
/*--------------------------------------------------------------------------------
--------------------------*/
--/*------to check whether user requested type which is listed in function
-----------------------------------*/
--
/*--------------------------------------------------------------------------------
--------------------------*/
raise others;
end if;
--
/*--------------------------------------------------------------------------------
--------------------------*/
--/*------if the user requested servicegroup as type then it will returns
servicegroupid as output------------*/
--
/*--------------------------------------------------------------------------------
--------------------------*/
begin
v_servicegroup := substr(servicegroup,1,instr(servicegroup,'.',1,1)-1);
return v_servicegroup;
end;
end if;
--
/*--------------------------------------------------------------------------------
--------------------------*/
--/*------if the user requested hub as type then it will returns hubid as
output------------------------------*/
--
/*--------------------------------------------------------------------------------
--------------------------*/
begin
v_servicegroup :=
substr(servicegroup,instr(servicegroup,'.',1,1)+1,(length(servicegroup)-
length(substr(servicegroup,instr(servicegroup,'.',1,2)+1))-
instr(servicegroup,'.',1,1))-1);
return v_servicegroup;
end;
end if;
--
/*--------------------------------------------------------------------------------
--------------------------*/
--/*------if the user requested headend as type then it will returns headend as
output------------------------*/
--
/*--------------------------------------------------------------------------------
--------------------------*/
begin
v_servicegroup := substr(servicegroup,instr(servicegroup,'.',1,2)+1);
return v_servicegroup;
end;
end if;
--
/*--------------------------------------------------------------------------------
--------------------------*/
--/*------to raise the application error if the input variable type is not in the
listed types ---------------*/
--
/*--------------------------------------------------------------------------------
--------------------------*/
exception
end;