Table Of Contents
Database Schema Functions
3.1 Prime Optical Functions
3.1.1 CollapsedDestNodeName
3.1.2 CollapsedDestNodeName
3.1.3 CollapsedEqptPortName
3.1.4 CollapsedIfIndex
3.1.5 CollapsedIfIndex
3.1.6 CollapsedModelType
3.1.7 CollapsedModuleName
3.1.8 CollapsedObjectIndex
3.1.9 CollapsedPhy
3.1.10 CollapsedPort
3.1.11 CollapsedPortModuleName
3.1.12 ConvertAxxIfIndex
3.1.13 ConvertLinkModuleType
3.1.14 CountCoSPh
3.1.15 CTMDuration
3.1.16 DisplayIf
3.1.17 DisplayIPAll
3.1.18 DisplayIP
3.1.19 DisplayPhyLoc
3.1.20 EqptInfoPort
3.1.21 Get_Enet_Value
3.1.22 Get_Enet_Value2
3.1.23 GetBccBwInfo
3.1.24 GetBccClassInfo
3.1.25 GetBccClassRPR80217
3.1.26 GetBccCosCommitGrp
3.1.27 GetBccCosInfo
3.1.28 GetBGFromBGObj
3.1.29 GetBGFromQoSObj
3.1.30 GetCktDestNodeId
3.1.31 GetCktSecSrcIfIndex
3.1.32 GetCktSecSrcPhysicalLoc
3.1.33 GetCktSecSrcPortName
3.1.34 GetCktSrcIfIndex
3.1.35 GetCktSrcPhysicalLoc
3.1.36 GetCktSrcPortName
3.1.37 GetCollapsedPortname
3.1.38 GetEqptInfoPhysicalLoc
3.1.39 GetIfCosGrp
3.1.40 GetInterfaceId
3.1.41 Get_Inventory_Note
3.1.42 GetLinkType
3.1.43 GetLowBits
3.1.44 GetMgx88xxMgmtState
3.1.45 GetMgx88xxSyncMode
3.1.46 GetMLcardAddnlInfo
3.1.47 GetModelTypeFromPhysicalLoc
3.1.48 GetModuleName
3.1.49 GetModuleName_PM
3.1.50 GetModuleName1
3.1.51 GetModuleName2
3.1.52 GetgetProtectMLcardConfigState
3.1.53 GetNEDBAccessID
3.1.54 GetNEIPAddr
3.1.55 GetObjectTypeFromIfIndex
3.1.56 GetObjectTypeFromIfIndex2
3.1.57 GetOutIPAddr
3.1.58 GetPhysicalLoc
3.1.59 GetPhysicalLocWithPIMPPM
3.1.60 GetPIM
3.1.61 GetPMParameterValue
3.1.62 GetPolicyMapType
3.1.63 GetPort
3.1.64 GetPort_XTC
3.1.65 GetPortModuleName
3.1.66 GetPortModuleName2
3.1.67 GetPortName
3.1.68 GetPortWithPIMPPM
3.1.69 GetPosPortState
3.1.70 GetPosPortStateForRPR802
3.1.71 GetPPM
3.1.72 GetProtectMLCardInfo
3.1.73 GetQoSPhLoc
3.1.74 GetShelf
3.1.75 GetSlot
3.1.76 GetSlotModuleName
3.1.77 GetSlotModuleType
3.1.78 GetSpanTblCktSpanDestNodeId
3.1.79 GetSpanTblCktSpanSrcNodeId
3.1.80 GetSubIf
3.1.81 GetValidCktSecSrcNodeId
3.1.82 GetValidCktSrcNodeId
3.1.83 GetValidModelType
3.1.84 GetValidModuleType
3.1.85 GetValidObjectType
3.1.86 Has_Next
3.1.87 IS_NUMBER
3.1.88 IsIPv6
3.1.89 MapObjectIndex
3.1.90 MergedInvalidityList
3.1.91 NE_Belongs_to_APC_Domain
3.1.92 RemoveFirstByteIf
3.1.93 RemoveLowBits
3.1.94 Time_Diff
3.1.95 TYPE AlarmInfoListType
3.1.96 TYPE AlarmInfoType
3.1.97 TYPE Link_Id_Tabtype
Database Schema Functions
This chapter describes the functions defined in Prime Optical tables. It contains the following section:
•
Prime Optical Functions
3.1 Prime Optical Functions
This section describes the functions that Prime Optical uses. Functions read parameters and return a value. The functions are listed in alphabetical order.
3.1.1 CollapsedDestNodeName
CREATE or replace function collapseddestnodename(CKTNODEIDIN varchar,CKTUNIQUEIDIN
varchar) return varchar2
cursor cktdestnodename is
where CKTNODEID=CKTNODEIDIN
and CKTUNIQUEID =CKTUNIQUEIDIN
and CktDestNodeId is not null;
finaldestNode varchar2(10000);
DestNedbaccessid varchar2(1000);
for rec in cktdestnodename loop
SELECT nedbaccessid INTO DestNedbaccessid
WHERE nenodeid= rec.CktDestNodeId and rec.CktDestNodeId != 0 ;
if cktdestnodename%ROWCOUNT = 1 then
finaldestNode:= DestNedbaccessid;
finaldestNode := finaldestNode||','||DestNedbaccessid;
3.1.2 CollapsedDestNodeName
CREATE or replace function collapseddestnodename (CKTNODEIDIN number,CKTUNIQUEIDIN number)
cursor cktdestnodename is
where CKTNODEID=CKTNODEIDIN
and CKTUNIQUEID =CKTUNIQUEIDIN
and CktCtpNodeId is not null;
finaldestNode varchar2(10000);
DestNedbaccessid varchar2(1000);
for rec in cktdestnodename loop
SELECT nedbaccessid INTO DestNedbaccessid
WHERE nenodeid= rec.CktCtpNodeId and rec.CktCtpNodeId != 0 ;
if cktdestnodename%ROWCOUNT = 1 then
finaldestNode:= DestNedbaccessid;
finaldestNode := finaldestNode||','||DestNedbaccessid;
END collapseddestnodename;
3.1.3 CollapsedEqptPortName
CREATE or replace function collapsedeqptportname(CKTNODEIDIN varchar,CKTUNIQUEIDIN
varchar)
cursor eqptcollpasedport is
where CKTNODEID=CKTNODEIDIN
and CKTUNIQUEID =CKTUNIQUEIDIN
and CktCtpNodeId is not null
and cktCtpPhysicalloc is not null
and cktCtpIfindex is not null
and cktCtpModuleType is not null;
finaleqptinfoport varchar2(10000);
DestNedbaccessid varchar2(1000);
for rec in eqptcollpasedport loop
SELECT nedbaccessid INTO DestNedbaccessid
WHERE nenodeid= rec.CktCtpNodeId and rec.CktCtpNodeId != 0;
if eqptcollpasedport%ROWCOUNT = 1 then
finaleqptinfoport:= '@'||eqptinfoport(DestNedbaccessid,rec.cktCtpPhysicalloc,0,
rec.cktCtpModuleType);
finaleqptinfoport :=
finaleqptinfoport||','||'@'||eqptinfoport(DestNedbaccessid,rec.cktCtpPhysicalloc,0,
rec.cktCtpModuleType);
return finaleqptinfoport;
END collapsedeqptportname;
3.1.4 CollapsedIfIndex
CREATE or replace function collapsedifindex (CKTNODEIDIN number,CKTUNIQUEIDIN number)
cursor cktobjectindexcursor is
where CKTNODEID=CKTNODEIDIN
and CKTUNIQUEID =CKTUNIQUEIDIN
and CktCtpIfIndex is not null;
finalifindex varchar2(10000);
for rec in cktobjectindexcursor loop
if cktobjectindexcursor%ROWCOUNT = 1 then
finalifindex:= rec.CktCtpIfIndex;
finalifindex := finalifindex||','||rec.CktCtpIfIndex;
3.1.5 CollapsedIfIndex
CREATE or replace function collapsedifindex (CKTNODEIDIN number,CKTUNIQUEIDIN number)
cursor cktobjectindexcursor is
where CKTNODEID=CKTNODEIDIN
and CKTUNIQUEID =CKTUNIQUEIDIN
and CktCtpIfIndex is not null;
finalifindex varchar2(10000);
for rec in cktobjectindexcursor loop
if cktobjectindexcursor%ROWCOUNT = 1 then
finalifindex:= rec.CktCtpIfIndex;
finalifindex := finalifindex||','||rec.CktCtpIfIndex;
3.1.6 CollapsedModelType
CREATE or replace function collapsedmodeltype (CKTNODEIDIN number,CKTUNIQUEIDIN number)
cursor cktmodeltypecursor is
where CKTNODEID=CKTNODEIDIN
and CKTUNIQUEID =CKTUNIQUEIDIN
and CKTCTPMODELTYPE is not null;
finalmoduletype varchar2(10000);
for rec in cktmodeltypecursor loop
if cktmodeltypecursor%ROWCOUNT = 1 then
finalmoduletype:= rec.CKTCTPMODELTYPE;
finalmoduletype := finalmoduletype||','||rec.CKTCTPMODELTYPE;
3.1.7 CollapsedModuleName
CREATE or replace function collapsedmodulename (CKTNODEIDIN number,CKTUNIQUEIDIN number)
cursor cktmodulenamecursor is
where CKTNODEID=CKTNODEIDIN
and CKTUNIQUEID =CKTUNIQUEIDIN
and CKTCTPMODULETYPE is not null;
finalcktdestModuleType varchar2(10000);
for rec in cktmodulenamecursor loop
SELECT trunc(rec.CKTCTPMODULETYPE/power(2,16)) INTO slotmoduletype FROM dual;
if cktmodulenamecursor%ROWCOUNT = 1 then
finalcktdestModuleType:= slotmoduletype;
finalcktdestModuleType := finalcktdestModuleType||','||slotmoduletype;
return finalcktdestModuleType;
3.1.8 CollapsedObjectIndex
CREATE or replace function collapsedobjectindex(CKTNODEIDIN number,CKTUNIQUEIDIN number)
cursor cktifindexcursor is
where CKTNODEID=CKTNODEIDIN
and CKTUNIQUEID =CKTUNIQUEIDIN
finalifindex varchar2(10000);
for rec in cktifindexcursor loop
if cktifindexcursor%ROWCOUNT = 1 then
finalifindex:= rec.CktCtpObjectType;
finalifindex := finalifindex||','||rec.CktCtpObjectType;
3.1.9 CollapsedPhy
CREATE or replace function collapsedphy (CKTNODEIDIN number,CKTUNIQUEIDIN number)
cursor cktphysicalloc_cursor is
where CKTNODEID=CKTNODEIDIN
and CKTUNIQUEID =CKTUNIQUEIDIN
and CKTCTPPHYSICALLOC is not null;
finalphy varchar2(10000);
for rec in cktphysicalloc_cursor loop
if cktphysicalloc_cursor%ROWCOUNT = 1 then
finalphy:= rec.CKTCTPPHYSICALLOC;
finalphy := finalphy||','||rec.CKTCTPPHYSICALLOC;
3.1.10 CollapsedPort
CREATE or replace function collapsedport(CKTNODEIDIN varchar,CKTUNIQUEIDIN varchar) return
varchar2
where CKTNODEID=CKTNODEIDIN
and CKTUNIQUEID =CKTUNIQUEIDIN
and cktdestportname is not null;
finaldest varchar2(10000);
for rec in cktdestcursor loop
if cktdestcursor%ROWCOUNT = 1 then
finaldest:= rec.cktdestportname;
finaldest := finaldest||','||rec.cktdestportname;
3.1.11 CollapsedPortModuleName
CREATE or replace function collapsedportmodulename(CKTNODEIDIN varchar,CKTUNIQUEIDIN
varchar) return varchar2
cursor cktmodulenamecursor is
where CKTNODEID=CKTNODEIDIN
and CKTUNIQUEID =CKTUNIQUEIDIN
and cktctptModuleType is not null;
finalcktdestModuleType varchar2(10000);
for rec in cktmodulenamecursor loop
SELECT trunc(mod(rec.cktctpModuleType,power(2,16))) INTO portmoduletype FROM dual;
if cktmodulenamecursor%ROWCOUNT = 1 then
finalcktdestModuleType:= portmoduletype;
finalcktdestModuleType := finalcktdestModuleType||','||portmoduletype;
return finalcktdestModuleType;
3.1.12 ConvertAxxIfIndex
CREATE OR REPLACE function convertaxxifindex(ifindex in number)
newifindex := ifindex - 1;
fifthByte := mod(newifindex, 4);
newifindex := floor(newifindex / 4);
forthByte := mod(newifindex, 8);
newifindex := floor(newifindex / 8);
thirdByte := mod(newifindex, 4);
newifindex := floor(newifindex / 4);
--secondByte := mod(newifindex, 4) + 1;
secondByte := mod(newifindex, 3) + 1;
newifindex := floor(newifindex / 3);
--firstByte := mod(newifindex, 4) + 1;
firstByte := mod(newifindex, 3) + 1;
result := result + (firstByte * POWER(2,56));
result := result + (secondByte * POWER(2,48));
result := result + (thirdByte * POWER(2,40));
result := result + (forthByte * POWER(2,32));
result := result + (fifthByte * POWER(2,24));
3.1.13 ConvertLinkModuleType
CREATE OR REPLACE function convertLinkModuleType (aModuleType number, aModelType number)
finalModuleType number(8);
if (aModelType in (3,14,5,24,18,30)) then
if(aModuleType < 0 or aModuleType > 2000) then
finalModuleType := aModuleType;
finalModuleType := aModuleType * power(2, 16);
finalModuleType := aModuleType;
3.1.14 CountCoSPh
CREATE OR REPLACE FUNCTION countCosPh(cosPhloc IN NUMBER)
IS SELECT UNIQUEID FROM TOPOLOGY_CIRCUIT_VIEW
WHERE SRCPHYSICALLOC=cosPhloc OR DESTPHYSICALLOC=cosPhloc;
IF cntPh%ROWCOUNT = 1 THEN return 1;
END IF; END LOOP; return 0;
END countCosPh; / show errors;
3.1.15 CTMDuration
create or replace function ctmduration(p_ctmduration in number)
CTMDuration_time varchar2(50);
IF (p_ctmduration = 0 ) THEN
SELECT trunc(p_ctmduration) INTO dddd FROM dual;
SELECT trunc((p_ctmduration-dddd)*24) INTO hh FROM dual;
IF ( hh <10 and hh>0 ) THEN
SELECT trunc((p_ctmduration-dddd)*24*60)-hh*60 INTO mm FROM dual;
IF (mm <10 and mm>0) THEN
SELECT trunc((p_ctmduration-dddd)*24*60*60)-hh*60*60-mm*60 INTO ss from dual;
IF (ss < 10 and ss>0 ) THEN
IF (dddd=0 or dddd is null) THEN
CTMDuration_time:=rtrim(hh_c||mm_c||ss_c,':');
CTMDuration_time:=rtrim(dddd||'d:'||hh_c||mm_c||ss_c,':');
3.1.16 DisplayIf
The displayif function is used to translate neifindex.
CREATE or REPLACE function displayif (neifindex in number)
o_interface varchar2(20);
i_neifindex := neifindex+power(2,32);
SELECT trunc(i_neifindex/power(2,24)) INTO iftype FROM dual;
SELECT decode(iftype,1,'System',
IF (ifstring='Equipment') THEN
o_interface:= 'Equipment';
SELECT trunc(mod(i_neifindex,power(2,8))) INTO if3 FROM dual;
SELECT decode(if3,0,'',if3) INTO o_if3 FROM dual;
SELECT mod(trunc(i_neifindex/power(2,8)),power(2,8)) INTO if2 FROM dual;
SELECT decode(if2,0,'',if2) INTO o_if2 FROM dual;
SELECT mod(trunc(i_neifindex/power(2,16)),power(2,8)) INTO if1 FROM dual;
o_interface := ifstring||' #'||if1||' '||o_if2||' '||o_if3;
o_interface := ifstring||' '||o_if2||' '||o_if3;
3.1.17 DisplayIPAll
function displayIpAll (NEIpaddr6 in raw, NEIpaddr in number, ipv6 in number)
--dbms_output.put_line(neipaddr);
select rawtohex(NEIpaddr6) into ipaddr from dual;
neipaddr_o:=NEIpaddr+power(2,32);
SELECT trunc(mod(NEIPaddr_o/power(2,24), power(2,8))) into first_sec from dual;
SELECT trunc(mod(NEIPaddr_o/power(2,16), power(2,8))) INTO second_sec from dual;
SELECT trunc(mod(NEIPaddr_o/power(2,8),power(2,8))) INTO third_sec from dual;
SELECT trunc(mod(NEIPaddr_o,power(2,8))) INTO fourth_sec from dual;
ipaddr:=first_sec||'.'||second_sec||'.'||third_sec||'.'||fourth_sec;
3.1.18 DisplayIP
Create or replace function displayIp (NEIpaddr in number)
--dbms_output.put_line(neipaddr);
neipaddr_o:=neipaddr+power(2,32);
SELECT trunc(mod(NEIPaddr_o/power(2,24), power(2,8))) into first_sec from dual;
SELECT trunc(mod(NEIPaddr_o/power(2,16), power(2,8))) INTO second_sec from dual;
SELECT trunc(mod(NEIPaddr_o/power(2,8),power(2,8))) INTO third_sec from dual;
SELECT trunc(mod(NEIPaddr_o,power(2,8))) INTO fourth_sec from dual;
ipaddr:=first_sec||'.'||second_sec||'.'||third_sec||'.'||fourth_sec;
rem return the string of the IP address in the two format ipv4 or ipv6
3.1.19 DisplayPhyLoc
The displayphloc function is used to determine the physical location.
Create or replace function displayphyloc (physicalloc in number)
o_physicalloc varchar2(40);
SELECT trunc(mod(physicalloc,power(2,10))) INTO port from dual;
SELECT mod(trunc(physicalloc/power(2,10)),power(2,6)) INTO ppm from dual;
SELECT mod(trunc(physicalloc/power(2,16)),power(2,8)) INTO pim from dual;
SELECT mod(trunc(physicalloc/power(2,24)),power(2,8)) INTO slot from dual;
SELECT mod(trunc(physicalloc/power(2,32)),power(2,8)) INTO shelf from dual;
SELECT mod(trunc(physicalloc/power(2,40)),power(2,8)) INTO rack from dual;
o_physicalloc :='Rack:'||rack||',Shelf:'||shelf||',Slot:'||slot||',Port:'||port;
3.1.20 EqptInfoPort
CREATE or replace function eqptinfoport(NEDBACCESSID_param number,
PHYSICALLOC_param number,
portnameselectedcol200 varchar2(4000);
portnameselectedcol3 varchar2(4000);
NEMODELTYPE_param number;
NEMODELINDEX_param number;
where nedbaccessid = NEDBACCESSID_param;
SlotModuleType:= getSlotModuleType(MODULEINDEX_param);
SELECT trunc(mod(MODULEINDEX_param,power(2,16))) INTO PortModuleType FROM dual;
PpmModuleType:= getPpm(PHYSICALLOC_param);
--create_file('/oraclesw9i','testf.log', 'NEMODELTYPE_param
:'||NEMODELTYPE_param||'NEMODELINDEX_param :'||NEMODELINDEX_param);
if (SlotModuleType = 157 or SlotModuleType = 146 or SlotModuleType = 232 or
SlotModuleType = 233 or SlotModuleType = 234) then
calc_OBJECTINDEX:= mapobjectIndex(neModelType_param , nemodelIndex_param ,
getport(PHYSICALLOC_param) ,0, PortModuleType);
if (PpmModuleType = 63) then
calc_OBJECTINDEX:= mapobjectIndex(neModelType_param , nemodelIndex_param ,
getport(PHYSICALLOC_param) ,0, SlotModuleType);
calc_OBJECTINDEX:= mapobjectIndex(neModelType_param , nemodelIndex_param ,
PpmModuleType ,0, SlotModuleType);
-- append_file('/oraclesw9i', 'testf.log', 'calc_OBJECTINDEX: '||calc_OBJECTINDEX);
-- append_file('/oraclesw9i','testf.log', 'PHYSICALLOC_param:'||PHYSICALLOC_param);
-- append_file('/oraclesw9i','testf.log','calc_Ifindex: '||calc_Ifindex);
PHYSICALLOC_temp := PHYSICALLOC_param;
if ( SlotModuleType = 47 ) then
PHYSICALLOC_temp := getPort_xtc(PHYSICALLOC_param, SlotModuleType);
if (NEMODELTYPE_param = 38) then
if (SlotModuleType = 233) then
if ( calc_OBJECTINDEX = 341 or calc_OBJECTINDEX = 342) then
PHYSICALLOC_temp := PHYSICALLOC_temp - 28;
elsif (SlotModuleType = 234) then
if ( calc_OBJECTINDEX = 341 or calc_OBJECTINDEX = 342) then
PHYSICALLOC_temp := PHYSICALLOC_temp - 84;
select col200,col3 into portnameselectedcol200,portnameselectedcol3
where NEDBACCESSID = NEDBACCESSID_param
and PHYSICALLOC = PHYSICALLOC_temp
and MODULETYPE = SlotModuleType
and OBJECTINDEX = calc_OBJECTINDEX;
if (calc_OBJECTINDEX = 193 or calc_OBJECTINDEX = 194) then
return portnameselectedcol3;
return portnameselectedcol200;
3.1.21 Get_Enet_Value
CREATE OR REPLACE function get_enet_value(
param3 IN number default -4,
param4 IN number default -4,
param5 IN number default -4,
param6 IN number default -4)
IF(param3 =-4 and param4 =-4 and param5 =-4 and param6 =-4) THEN
IF(param1 < 0 and param2 < 0) THEN
IF ( (param1=param2)) THEN
ELSIF (param1 = -3 or param2 = -3)THEN
ELSIF ( param1 = -2 or param2 = -2 ) THEN
ELSIF ( param1 = -1 or param2 = -1 ) THEN
ELSIF((param3 > -4) and (param4 =-4) and (param5 =-4) and (param6 =-4)) THEN
IF(param1 < 0 and param2 < 0 and param3 < 0) THEN
IF ( (param1=param2) and (param2=param3) ) THEN
ELSIF (param1 = -3 or param2 = -3 or param3 = -3)THEN
ELSIF ( param1 = -2 or param2 = -2 or param3 = -2 ) THEN
ELSIF ( param1 = -1 or param2 = -1 or param3 = -1 ) THEN
ELSIF((param3 > -4) and (param4 > -4) and (param5 =-4) and (param6 =-4)) THEN
IF(param1 < 0 and param2 < 0 and param3 < 0 and param4 < 0) THEN
IF ( ((param1=param2) and (param2=param3) and (param3=param4))) THEN
ELSIF (param1 = -3 or param2 = -3 or param3 = -3 or param4 = -3)THEN
ELSIF ( param1 = -2 or param2 = -2 or param3 = -2 or param4 = -2 ) THEN
ELSIF ( param1 = -1 or param2 = -1 or param3 = -1 or param4 = -1 ) THEN
ELSIF((param3 > -4) and (param4 > -4) and (param5 >-4) and (param6 =-4)) THEN
IF(param1 < 0 and param2 < 0 and param3 < 0 and param4 < 0 and param5 < 0) THEN
IF ( ((param1=param2) and (param2=param3) and (param3=param4) and
(param4=param5))) THEN
ELSIF (param1 = -3 or param2 = -3 or param3 = -3 or param4 = -3 or param5
=-3)THEN
ELSIF ( param1 = -2 or param2 = -2 or param3 = -2 or param4 = -2 or param5 = -2)
THEN
ELSIF ( param1 = -1 or param2 = -1 or param3 = -1 or param4 = -1 or param5 = -1)
THEN
ELSIF((param3 > -4) and (param4 > -4) and (param5 >-4) and (param6 >-4)) THEN
IF(param1 < 0 and param2 < 0 and param3 < 0 and param4 < 0 and param5 < 0 and param6 <
0) THEN
IF ( ((param1=param2) and (param2=param3) and (param3=param4) and (param4=param5)
and (param5=param6))) THEN
ELSIF(param1 = -3 or param2 = -3 or param3 = -3 or param4 = -3 or param5 =-3
or param6=-3) THEN
ELSIF ( param1 = -2 or param2 = -2 or param3 = -2 or param4 = -2 or param5 = -2 or
param6 = -2) THEN
ELSIF ( param1 = -1 or param2 = -1 or param3 = -1 or param4 = -1 or param5 = -1 or
param6 = -1) THEN
r_value:=val1+val2+val3+val4+val5+val6;
3.1.22 Get_Enet_Value2
CREATE OR REPLACE function get_enet_value2(
param3 IN number default -4,
param4 IN number default -4,
param5 IN number default -4,
param6 IN number default -4)
IF(param3 =-4 and param4 =-4 and param5 =-4 and param6 =-4) THEN
IF(param1 < 0 and param2 < 0) THEN
IF ( (param1=param2)) THEN
r_value:=to_char(param1);
ELSIF (param1 = -3 or param2 = -3)THEN
ELSIF ( param1 = -2 or param2 = -2 ) THEN
ELSIF ( param1 = -1 or param2 = -1 ) THEN
ELSIF((param3 > -4) and (param4 =-4) and (param5 =-4) and (param6 =-4)) THEN
IF(param1 < 0 and param2 < 0 and param3 < 0) THEN
IF ( (param1=param2) and (param2=param3) ) THEN
r_value:=to_char(param1);
ELSIF (param1 = -3 or param2 = -3 or param3 = -3)THEN
ELSIF ( param1 = -2 or param2 = -2 or param3 = -2 ) THEN
ELSIF ( param1 = -1 or param2 = -1 or param3 = -1 ) THEN
ELSIF((param3 > -4) and (param4 > -4) and (param5 =-4) and (param6 =-4)) THEN
IF(param1 < 0 and param2 < 0 and param3 < 0 and param4 < 0) THEN
IF ( ((param1=param2) and (param2=param3) and (param3=param4))) THEN
r_value:=to_char(param1);
ELSIF (param1 = -3 or param2 = -3 or param3 = -3 or param4 = -3)THEN
ELSIF ( param1 = -2 or param2 = -2 or param3 = -2 or param4 = -2 ) THEN
ELSIF ( param1 = -1 or param2 = -1 or param3 = -1 or param4 = -1 ) THEN
ELSIF((param3 > -4) and (param4 > -4) and (param5 >-4) and (param6 =-4)) THEN
IF(param1 < 0 and param2 < 0 and param3 < 0 and param4 < 0 and param5 < 0) THEN
IF ( ((param1=param2) and (param2=param3) and (param3=param4) and
(param4=param5))) THEN
r_value:=to_char(param1);
ELSIF (param1 = -3 or param2 = -3 or param3 = -3 or param4 = -3 or param5
=-3)THEN
ELSIF ( param1 = -2 or param2 = -2 or param3 = -2 or param4 = -2 or param5 = -2)
THEN
ELSIF ( param1 = -1 or param2 = -1 or param3 = -1 or param4 = -1 or param5 = -1)
THEN
ELSIF((param3 > -4) and (param4 > -4) and (param5 >-4) and (param6 >-4)) THEN
IF(param1 < 0 and param2 < 0 and param3 < 0 and param4 < 0 and param5 < 0 and param6 <
0) THEN
IF ( ((param1=param2) and (param2=param3) and (param3=param4) and (param4=param5)
and (param5=param6))) THEN
r_value:=to_char(param1);
ELSIF(param1 = -3 or param2 = -3 or param3 = -3 or param4 = -3 or param5 =-3
or param6=-3) THEN
ELSIF ( param1 = -2 or param2 = -2 or param3 = -2 or param4 = -2 or param5 = -2 or
param6 = -2) THEN
ELSIF ( param1 = -1 or param2 = -1 or param3 = -1 or param4 = -1 or param5 = -1 or
param6 = -1) THEN
r_value:=to_char(val1+val2+val3+val4+val5+val6);
3.1.23 GetBccBwInfo
CREATE OR REPLACE FUNCTION getBccBwInfo(neId IN NUMBER, phLoc IN NUMBER, objIdx IN NUMBER,
COLUMN IN VARCHAR2)
SELECT COL16 INTO retVal FROM EQPT_INFO_TABLE WHERE NeDbAccessId = neId AND
ObjectIndex = objIdx AND
PHYSICALLOC = phLoc AND COL2 = COLUMN;
3.1.24 GetBccClassInfo
CREATE OR REPLACE FUNCTION getBccClassInfo(neId IN NUMBER, phLoc IN NUMBER, objIdx IN
NUMBER, COLUMN IN VARCHAR2)
SELECT COL19 INTO retVal FROM EQPT_INFO_TABLE WHERE NeDbAccessId = neId AND
ObjectIndex = objIdx AND
PHYSICALLOC = phLoc AND COL2 = COLUMN;
3.1.25 GetBccClassRPR80217
CREATE OR REPLACE FUNCTION getBccClassRPR80217(neId IN NUMBER, phLoc IN NUMBER, objIdx IN
NUMBER, COLUMN IN NUMBER)
IF (COLUMN = 1) THEN -- Select column called COL1
SELECT COL1 INTO retVal FROM EQPT_INFO_TABLE WHERE NeDbAccessId = neId AND
ObjectIndex = objIdx AND
PHYSICALLOC = phLoc AND IFINDEX = 0;
IF (COLUMN = 2) THEN -- Select column called COL2
SELECT COL2 INTO retVal FROM EQPT_INFO_TABLE WHERE NeDbAccessId = neId AND
ObjectIndex = objIdx AND
PHYSICALLOC = phLoc AND IFINDEX = 0;
IF (COLUMN = 3) THEN -- Select column called COL3
SELECT COL3 INTO retVal FROM EQPT_INFO_TABLE WHERE NeDbAccessId = neId AND
ObjectIndex = objIdx AND
PHYSICALLOC = phLoc AND IFINDEX = 0;
3.1.26 GetBccCosCommitGrp
CREATE OR REPLACE FUNCTION getBccCosCommitGrp(neId IN NUMBER, phLoc IN NUMBER, infoNum IN
NUMBER, objIdx IN NUMBER)
IF infoNum = 0 THEN -- cos
SELECT COL2 INTO retVal FROM EQPT_INFO_TABLE WHERE NeDbAccessId=neId AND
ObjectIndex=objIdx AND
PHYSICALLOC=phLoC AND COL2 IS NOT NULL;
IF infoNum = 11 THEN -- Multicast Group 1
ifIdx := getIfCosGrp(neId, phLoc, 1);
SELECT COL4 INTO retVal FROM EQPT_INFO_TABLE WHERE NeDbAccessId=neId AND
ObjectIndex=objIdx AND
PHYSICALLOC=phLoC AND IFINDEX=ifIdx AND COL4 IS NOT NULL;
IF infoNum = 12 THEN -- Class Off service Group 1
ifIdx := getIfCosGrp(neId, phLoc, 1);
SELECT COL3 INTO retVal FROM EQPT_INFO_TABLE WHERE NeDbAccessId=neId AND
ObjectIndex=objIdx AND
PHYSICALLOC=phLoC AND IFINDEX=ifIdx AND COL3 IS NOT NULL;
IF infoNum = 21 THEN -- Multicast Group 2
ifIdx := getIfCosGrp(neId, phLoc, 2);
SELECT COL4 INTO retVal FROM EQPT_INFO_TABLE WHERE NeDbAccessId=neId AND
ObjectIndex=objIdx AND
PHYSICALLOC=phLoC AND IFINDEX=ifIdx AND COL4 IS NOT NULL;
IF infoNum = 22 THEN -- Class Off service Group 2
ifIdx := getIfCosGrp(neId, phLoc, 2);
SELECT COL3 INTO retVal FROM EQPT_INFO_TABLE WHERE NeDbAccessId=neId AND
ObjectIndex=objIdx AND
PHYSICALLOC=phLoC AND IFINDEX=ifIdx AND COL3 IS NOT NULL;
3.1.27 GetBccCosInfo
CREATE OR REPLACE FUNCTION getBccCosInfo(neId IN NUMBER, phLoc IN NUMBER, objIdx IN
NUMBER, COLUMN IN VARCHAR2)
SELECT COL26 INTO retVal FROM EQPT_INFO_TABLE WHERE NeDbAccessId = neId AND
ObjectIndex = objIdx AND
PHYSICALLOC = phLoc AND COL2 = COLUMN;
3.1.28 GetBGFromBGObj
Create or replace function getBGFromBGObj(neifindex in number)
i_neifindex := neifindex+power(2,32);
SELECT mod(trunc(i_neifindex/power(2,16)),power(2,8)) INTO if1 FROM dual;
3.1.29 GetBGFromQoSObj
Create or replace function getBGFromQoSObj (neifindex in number)
i_neifindex := neifindex+power(2,32);
SELECT mod(trunc(i_neifindex/power(2,8)),power(2,8)) INTO if2 FROM dual;
SELECT decode(if2,0,'',if2) INTO o_if2 FROM dual;
3.1.30 GetCktDestNodeId
CREATE or replace function getCktDestNodeId (CKTNODEIDIN number,CKTUNIQUEIDIN number)
cursor cktnodeidcursor is
where CktNodeId = CKTNODEIDIN
and CktUniqueId = CKTUNIQUEIDIN
finalinodeids varchar2(10000);
for rec in cktnodeidcursor loop
if cktnodeidcursor%ROWCOUNT = 1 then
finalinodeids:= rec.CktCtpNodeId;
finalinodeids := finalinodeids||','||rec.CktCtpNodeId;
3.1.31 GetCktSecSrcIfIndex
CREATE or replace function getCktSecSrcIfIndex (CKTNODEIDIN number,CKTUNIQUEIDIN number)
o_CktSecSrcIfIndex number;
select CktCtpIfIndex into o_CktSecSrcIfIndex
where CktCtpNodeId = CKTNODEIDIN
and CktUniqueId = CKTUNIQUEIDIN
return o_CktSecSrcIfIndex;
3.1.32 GetCktSecSrcPhysicalLoc
CREATE or replace function getCktSecSrcPhysicalLoc (CKTNODEIDIN number,CKTUNIQUEIDIN
number)return number
o_CktSecSrcPhysicalLoc number;
select CktCtpPhysicalLoc into o_CktSecSrcPhysicalLoc
where CktCtpNodeId = CKTNODEIDIN
and CktUniqueId = CKTUNIQUEIDIN
return o_CktSecSrcPhysicalLoc;
END getCktSecSrcPhysicalLoc;
3.1.33 GetCktSecSrcPortName
CREATE or replace function getCktSecSrcPortName (CKTNODEIDIN number,CKTUNIQUEIDIN number)
o_CktSecSrcPortName varchar2(64);
select CKTCTPPORTNAME into o_CktSecSrcPortName
where CktNodeId = CKTNODEIDIN
and CktUniqueId = CKTUNIQUEIDIN
return o_CktSecSrcPortName;
END getCktSecSrcPortName;
3.1.34 GetCktSrcIfIndex
CREATE or replace function getCktSrcIfIndex (CKTNODEIDIN number,CKTUNIQUEIDIN number)
select CktCtpIfIndex into o_CktSrcIfIndex
where CktCtpNodeId = CKTNODEIDIN
and CktUniqueId = CKTUNIQUEIDIN
3.1.35 GetCktSrcPhysicalLoc
CREATE or replace function getCktSrcPhysicalLoc (CKTNODEIDIN number,CKTUNIQUEIDIN number)
o_CktSrcPhysicalLoc number;
select CktCtpPhysicalLoc into o_CktSrcPhysicalLoc
where CktCtpNodeId = CKTNODEIDIN
and CktUniqueId = CKTUNIQUEIDIN
return o_CktSrcPhysicalLoc;
END getCktSrcPhysicalLoc;
3.1.36 GetCktSrcPortName
CREATE or replace function getCktSrcPortName (CKTNODEIDIN number,CKTUNIQUEIDIN number)
o_CktSrcPortName varchar2(64);
select CKTCTPPORTNAME into o_CktSrcPortName
where CktNodeId = CKTNODEIDIN
and CktUniqueId = CKTUNIQUEIDIN
3.1.37 GetCollapsedPortname
CREATE or replace function getcollapsedPortname(CKTNODEIDIN number,CKTUNIQUEIDIN number)
cursor eqptcollpasedport is
where CKTNODEID=CKTNODEIDIN
and CKTUNIQUEID =CKTUNIQUEIDIN
and CktNodeId is not null
and CktCtpPhysicalLoc is not null
and CktCtpIfIndex is not null
and CktCtpModuleType is not null;
finaleqptinfoport varchar2(10000);
DestNedbaccessid varchar2(1000);
for rec in eqptcollpasedport loop
SELECT nedbaccessid INTO DestNedbaccessid
WHERE nenodeid= rec.CktNodeId and rec.CktNodeId != 0;
if eqptcollpasedport%ROWCOUNT = 1 then
finaleqptinfoport:=
'@'||eqptinfoport(DestNedbaccessid,rec.CktCtpPhysicalLoc,rec.CktCtpIfIndex,rec.CktCtpModul
eType);
finaleqptinfoport :=
finaleqptinfoport||','||'@'||eqptinfoport(DestNedbaccessid,rec.CktCtpPhysicalLoc,rec.CktCt
pIfIndex,rec.CktCtpModuleType);
return finaleqptinfoport;
3.1.38 GetEqptInfoPhysicalLoc
Create or replace function getEqptInfoPhysicalLoc(physicalLoc in number,moduleIndex in
number)
slot:= getSlot(physicalLoc);
port:= getPortWithPimPpm(physicalLoc);
pim:= getPIM(physicalLoc);
ppm:= getPPM(physicalLoc);
slotmoduletype:=getSlotModuleType(moduleIndex);
SELECT trunc(mod(moduleIndex,power(2,16))) INTO portmoduletype FROM dual;
IF (pim = 0 AND slotmoduletype = 157 AND portmoduletype != 34 AND ppm = 0) THEN
eqptphysicalLoc:= getPhysicalLoc(slot,port);
eqptphysicalLoc:= physicalLoc;
END getEqptInfoPhysicalLoc;
3.1.39 GetIfCosGrp
CREATE OR REPLACE FUNCTION getIfCosGrp(neId IN NUMBER, phLoc IN NUMBER, first_last IN
NUMBER )
WHERE NEDBACCESSID=neId AND OBJECTINDEX=189 AND PHYSICALLOC=phLoc AND COL3 IS NOT
NULL;
IF (first_last = 1) THEN -- find first
IF (first_last = 2) THEN -- find last
IF MCursor%ROWCOUNT = first_last THEN
3.1.40 GetInterfaceId
create or replace function GetInterfaceId
(p_nedbaccessid IN number,
p_moduleorIfIndex IN number,
o_interfaceId varchar2(64);
IF (p_moduleOrIfindex = 0 ) THEN
IF (p_objectType = 0 ) THEN
select activevalue into o_interfaceId from ctm_config_table
where sectionname='transportManager' and propertyname='ems-sys-id';
SELECT nemodeltype INTO o_modeltype
WHERE nedbaccessid=p_nedbaccessid;
IF (o_modeltype = 34) THEN
IF (p_moduleOrIfindex = -1) THEN
IF ((p_moduleOrIfindex != 0 ) and (p_moduleOrIfindex != -1)) THEN
IF (p_nedbaccessid =0 ) THEN
IF (p_type like 'Maximum login attempts exceeded%') THEN
SELECT username INTO o_interfaceId
WHERE userid=p_moduleorIfIndex;
o_interfaceId:= displayIp(p_moduleOrIfindex);
ELSIF (p_type like 'Server Monitor Threshold Crossed%') THEN
select displayname into o_interfaceId
FROM SERVER_PARAMETER_TABLE
WHERE ParameterIndex=p_moduleorIfIndex;
SELECT nesysid INTO o_interfaceId
WHERE nedbaccessid=p_moduleorIfIndex AND nemodeltype!=34;
SELECT nemodeltype INTO o_modeltype
WHERE nedbaccessid=p_nedbaccessid;
IF (o_modeltype = 34) THEN
o_interfaceId:=p_moduleorIfIndex;
3.1.41 Get_Inventory_Note
FUNCTION "GET_INVENTORY_NOTE" (sn IN VARCHAR2) RETURN VARCHAR2
select count(*) into cnt from ONS15454_INVENTORY_NOTES where SERIALNUMBER = sn;
select NOTE into retVal from ONS15454_INVENTORY_NOTES where SERIALNUMBER = sn;
3.1.42 GetLinkType
CREATE OR REPLACE function GetLinkType
(p_circuitprot IN number,
o_linktype_18 number:=18;
o_linktype_13 number:=13;
o_linktype number:=p_linktype;
IF ((p_circuitprot = 5) OR (p_circuitprot = 6)) THEN
select count(*) into o_linkcount from
CIRCUIT_CTP_TBL ctp1, CIRCUIT_CTP_TBL ctp2, CIRCUIT_SPAN_BS_TBL spn,
LINK_TABLE lnk, CIRCUIT_BS_TBL circuit
spn.CKTSPANSRCCTPACCESSID = ctp1.CTPACCESSID
spn.CKTSPANDSTCTPACCESSID = ctp2.CTPACCESSID
circuit.CKTNODEID = spn.CKTNODEID
circuit.CKTUNIQUEID = spn.CKTUNIQUEID
( ctp1.CKTCTPPHYSICALLOC = lnk.LINKSRCPHYSICALLOC AND
ctp1.CKTCTPNEDBACCESSID = lnk.LINKSRCNODE AND
ctp2.CKTCTPPHYSICALLOC = lnk.LINKDSTPHYSICALLOC AND
ctp2.CKTCTPNEDBACCESSID = lnk.LINKDSTNODE )
( ctp1.CKTCTPPHYSICALLOC = lnk.LINKDSTPHYSICALLOC AND
ctp1.CKTCTPNEDBACCESSID = lnk.LINKDSTNODE AND
ctp2.CKTCTPPHYSICALLOC = lnk.LINKSRCPHYSICALLOC AND
ctp2.CKTCTPNEDBACCESSID = lnk.LINKSRCNODE )
AND lnk.linktype in (0, 4)
AND spn.CKTSPANBSID = p_spanid;
if ( o_linkcount > 1 ) then
o_linktype := o_linktype_4;
o_linktype := o_linktype_0;
if (p_linktype = 4 ) THEN
o_linktype := o_linktype_0;
if ( p_circuittype = 38 ) THEN
select count(*) into o_linkcount from
CIRCUIT_CTP_TBL ctp1, CIRCUIT_CTP_TBL ctp2, CIRCUIT_SPAN_BS_TBL spn,
LINK_TABLE lnk, CIRCUIT_BS_TBL circuit
spn.CKTSPANSRCCTPACCESSID = ctp1.CTPACCESSID
spn.CKTSPANDSTCTPACCESSID = ctp2.CTPACCESSID
circuit.CKTNODEID = spn.CKTNODEID
circuit.CKTUNIQUEID = spn.CKTUNIQUEID
( ctp1.CKTCTPPHYSICALLOC = lnk.LINKSRCPHYSICALLOC AND
ctp1.CKTCTPNEDBACCESSID = lnk.LINKSRCNODE AND
ctp2.CKTCTPPHYSICALLOC = lnk.LINKDSTPHYSICALLOC AND
ctp2.CKTCTPNEDBACCESSID = lnk.LINKDSTNODE )
( ctp1.CKTCTPPHYSICALLOC = lnk.LINKDSTPHYSICALLOC AND
ctp1.CKTCTPNEDBACCESSID = lnk.LINKDSTNODE AND
ctp2.CKTCTPPHYSICALLOC = lnk.LINKSRCPHYSICALLOC AND
ctp2.CKTCTPNEDBACCESSID = lnk.LINKSRCNODE )
AND lnk.linktype = o_linktype_18
AND spn.CKTSPANBSID = p_spanid;
if ( o_linkcount > 0 ) then
o_linktype := o_linktype_18;
select count(*) into o_linkcount from
CIRCUIT_CTP_TBL ctp1, CIRCUIT_CTP_TBL ctp2, CIRCUIT_SPAN_BS_TBL spn,
LINK_TABLE lnk, CIRCUIT_BS_TBL circuit
spn.CKTSPANSRCCTPACCESSID = ctp1.CTPACCESSID
spn.CKTSPANDSTCTPACCESSID = ctp2.CTPACCESSID
circuit.CKTNODEID = spn.CKTNODEID
circuit.CKTUNIQUEID = spn.CKTUNIQUEID
(( ctp1.CKTCTPPHYSICALLOC = lnk.LINKSRCPHYSICALLOC AND
ctp1.CKTCTPNEDBACCESSID = lnk.LINKSRCNODE AND
ctp2.CKTCTPPHYSICALLOC = lnk.LINKDSTPHYSICALLOC AND
ctp2.CKTCTPNEDBACCESSID = lnk.LINKDSTNODE )
( ctp1.CKTCTPPHYSICALLOC = lnk.LINKDSTPHYSICALLOC AND
ctp1.CKTCTPNEDBACCESSID = lnk.LINKDSTNODE AND
ctp2.CKTCTPPHYSICALLOC = lnk.LINKSRCPHYSICALLOC AND
ctp2.CKTCTPNEDBACCESSID = lnk.LINKSRCNODE ))
AND lnk.linktype = o_linktype_13
AND spn.CKTSPANBSID = p_spanid;
if ( o_linkcount > 0 ) THEN
o_linktype := o_linktype_13;
3.1.43 GetLowBits
CREATE OR REPLACE function getLowBits (aNum number, numOfBits integer)
modVal := power (2, numOfBits);
result := mod (aNum, modVal);
3.1.44 GetMgx88xxMgmtState
create or replace function getMgx88xxMgmtState(p_isConnected in number)
IF ( p_isConnected = 1 ) THEN
3.1.45 GetMgx88xxSyncMode
create or replace function getMgx88xxSyncMode(p_discoveryState in number)
IF ( p_discoveryState = 1 ) THEN
ELSE IF ( p_discoveryState = 2 ) THEN
ELSE IF ( p_discoveryState = 3 ) THEN
ELSE IF ( p_discoveryState = 4 ) THEN
3.1.46 GetMLcardAddnlInfo
This function indicates whether the ML card has been preprovisioned.
CREATE OR REPLACE function getMLcardAddnlInfo(AddnlInfo in varchar2, state in number)
RETURN 'EID-7077: ML Card was Pre-provisioned';
3.1.47 GetModelTypeFromPhysicalLoc
CREATE OR REPLACE function getModelTypeFromPhysicalloc (aPHYSICALLOC number)
aModelType := removeLowBits(aPHYSICALLOC, 56);
3.1.48 GetModuleName
create or replace function getModuleName(p_nedbaccessid in number, p_moduletype in number,
p_eventType in number)
o_modulename varchar2(64);
IF ( p_nedbaccessid = 0 or ( p_eventType >= 4 AND p_moduletype = 9999) ) THEN
SELECT nemodeltype INTO i_modeltype
WHERE nedbaccessid=p_nedbaccessid;
SELECT ModuleName INTO o_modulename
WHERE moduletype=p_moduletype
AND modeltype=i_modeltype;
3.1.49 GetModuleName_PM
create or replace function getModuleName_pm(p_nenodeid in number, p_moduletype in number)
o_modulename varchar2(64);
IF (p_nenodeid=0 OR p_moduletype=0) THEN
SELECT nemodeltype INTO i_modeltype
WHERE nenodeid=p_nenodeid;
SELECT ModuleName INTO o_modulename
WHERE moduletype=p_moduletype
AND modeltype=i_modeltype;
3.1.50 GetModuleName1
create or replace function getModuleName1(p_nenodeid in number, p_moduletype in number)
o_modulename varchar2(64);
SELECT trunc(p_moduletype/power(2,16)) INTO p_slotmoduletype FROM dual;
IF (p_nenodeid=0 OR p_slotmoduletype=0) THEN
SELECT nemodeltype INTO i_modeltype
WHERE nenodeid=p_nenodeid;
SELECT ModuleName INTO o_modulename
WHERE moduletype=p_slotmoduletype
AND modeltype=i_modeltype;
3.1.51 GetModuleName2
create or replace function getModuleName2 (p_moduletype number, p_modeltype number)
o_modulename varchar2(64);
SELECT trunc(p_moduletype/power(2,16)) INTO p_slotmoduletype FROM dual;
IF (p_slotmoduletype=0) THEN
SELECT ModuleName INTO o_modulename
WHERE moduletype=p_slotmoduletype
AND modeltype=p_modeltype;
3.1.52 GetgetProtectMLcardConfigState
--This function returns the config status of a protected card, return -1 if not found.
CREATE OR REPLACE function getProtectMLcardConfigState(NEDbId in number, Slot in number)
Select configState into confStValue from MCard_Table where NeDbaccessID = NEDbId
and SlotNumber = Slot;
END getProtectMLcardConfigState;
3.1.53 GetNEDBAccessID
create or replace function getNEDBACCESSID(NodeId_param number)
rem Function that return the IP address
3.1.54 GetNEIPAddr
CREATE OR REPLACE function getNEIPAddr (p_NEDBAccessid number)
select is_ipv6 into isipv6 from ne_info_table where nedbaccessid = p_NEDBAccessid;
select neipv6addr into nedbIPaddr from ne_info_table where nedbaccessid =
p_NEDBAccessid;
select neipaddr into c_nedbIPaddr from ne_info_table where nedbaccessid =
p_NEDBAccessid;
-- dbms_output.put_line ('IPv4 =' || c_nedbIPaddr || 'IPv4 BIN =' ||
binary_utility.to_hex(c_nedbIPaddr));
nedbIpaddrV4 := utl_raw.CAST_FROM_BINARY_INTEGER(c_nedbIPaddr);
rem Function that check if the IP is a IPv4 (return 0) or a IPv6 (return 1)
3.1.55 GetObjectTypeFromIfIndex
CREATE OR REPLACE function getObjectTypeFromIfIndex (aIfindex number)
if(sign(aIfindex) = -1) then
aObjectType := removeLowBits(aIfindex+power(2,32), 24);
aObjectType := removeLowBits(aIfindex, 24);
3.1.56 GetObjectTypeFromIfIndex2
CREATE OR REPLACE function getObjectTypeFromIfIndex2 ( amodelType number,aIfindex number)
if(sign(aIfindex) = -1) then
aObjectType := removeLowBits(aIfindex+power(2,32), 24);
aObjectType := removeLowBits(aIfindex, 24);
if (amodelType in (3, 14, 5, 29, 18, 30)) THEN
select decode(aobjectType, 19, 5130,
aobjectType+5000) into aobjectType from dual;
3.1.57 GetOutIPAddr
function getOUTIPAddr (p_ossname varchar)
select is_ipv6 into isipv6 from oss_user_table where ossname = p_ossname;
select IPV6Addr into nedbIPaddr from oss_user_table where ossname = p_ossname;
select IPAddress into c_nedbIPaddr from oss_user_table where ossname = p_ossname;
-- dbms_output.put_line ('IPv4 =' || c_nedbIPaddr || 'IPv4 BIN =' ||
binary_utility.to_hex(c_nedbIPaddr));
nedbIpaddrV4 := utl_raw.CAST_FROM_BINARY_INTEGER(c_nedbIPaddr);
3.1.58 GetPhysicalLoc
Create or replace function getPhysicalLoc(slot in number,port in number)
physlot:= slot * power(2,16);
physicalLoc:= physlot + port;
3.1.59 GetPhysicalLocWithPIMPPM
Create or replace function getPhysicalLocWithPimPpm(shelf in number, slot in number, pim
in number, ppm in number, port in number)
phyrack:= 1 * power(2,40);
physhelf:= shelf * power(2,32);
physlot:= slot * power(2,24);
phypim:= pim * power(2,16);
phyppm:= ppm * power(2,10);
physicalLoc:= phyrack + physhelf + physlot + phypim + phyppm + port;
END getPhysicalLocWithPimPpm;
3.1.60 GetPIM
Create or replace function getPIM (physicalloc in number)
SELECT trunc(mod(trunc(physicalloc/power(2,16)),power(2,8))) INTO pim from dual;
3.1.61 GetPMParameterValue
CREATE OR REPLACE function GetPMParameterValue
IF (p_paramvalue = -1 AND l_paramvalue <> -1) THEN
o_paramvalue:= l_paramvalue;
ELSIF (l_paramvalue = -1 AND p_paramvalue <> -1) THEN
o_paramvalue:= p_paramvalue;
o_paramvalue:= p_paramvalue;
3.1.62 GetPolicyMapType
Create or replace function getPolicyMapType(neifindex in number)
i_neifindex := neifindex+power(2,32);
SELECT mod(trunc(i_neifindex/power(2,16)),power(2,8)) INTO if1 FROM dual;
3.1.63 GetPort
Create or replace function getPort (physicalloc in number)
SELECT trunc(mod(physicalloc,power(2,10))) INTO port from dual;
3.1.64 GetPort_XTC
Create or replace function getPort_xtc (physicalloc in number, moduletype_param in
number )
final_physicalloc number;
two_bytes number := power(2,16);
ppm := getPPM(physicalloc);
port := getPort(physicalloc);
if ( moduletype_param = 47 ) then
-- append_file('/oraclesw9i', 'testfjune9.log', 'Port No. Passed is : '|| port);
-- append_file('/oraclesw9i', 'testfjune9.log', 'Returning port no. : '|| port);
final_physicalloc := trunc(physicalloc/two_bytes) * two_bytes;
final_physicalloc := final_physicalloc + port;
RETURN final_physicalloc;
3.1.65 GetPortModuleName
create or replace function getPortModuleName(p_nenodeid in number, p_moduletype in number)
o_modulename varchar2(64);
SELECT trunc(mod(p_moduletype,power(2,16))) INTO p_portmoduletype FROM dual;
IF (p_nenodeid=0 OR p_portmoduletype=0) THEN
SELECT nemodeltype INTO i_modeltype
WHERE nenodeid=p_nenodeid;
SELECT ModuleName INTO o_modulename
WHERE moduletype=p_portmoduletype
AND modeltype=i_modeltype;
3.1.66 GetPortModuleName2
create or replace function getPortModuleName2(p_moduleindex number, p_modeltype number)
o_modulename varchar2(64);
SELECT mod(p_moduleindex, power(2,16)) INTO p_portmoduletype FROM dual;
IF (p_portmoduletype=0 ) THEN
o_modulename:= getModuleName2(p_moduleindex, p_modeltype);
SELECT ModuleName INTO o_modulename
WHERE moduletype=p_portmoduletype
AND modeltype=p_modeltype;
3.1.67 GetPortName
CREATE or REPLACE function GetPortName
(p_nedbaccessid IN number,
o_portname varchar2(256);
i_ifindex := p_ifindex+power(2,32);
module_type := p_moduletype;
ppm := GetPpm(p_physicalloc);
SELECT round(i_ifindex/power(2,24)) INTO iftype FROM dual;
SELECT nemodeltype INTO model_type FROM ne_info_table WHERE nedbaccessid =
p_nedbaccessid;
IF ( iftype = 31 and p_moduletype=47 ) THEN /* 31=ds1 47=XTC */
SELECT col200 INTO o_portname
WHERE nedbaccessid=p_nedbaccessid
AND physicalloc=p_physicalloc
AND moduletype=p_moduletype;
ELSIF (iftype = 33 and p_moduletype = 47 ) THEN /* 33=ds3 47=XTC */
SELECT col200 INTO o_portname
WHERE nedbaccessid=p_nedbaccessid
AND physicalloc=p_physicalloc
AND moduletype=p_moduletype;
ELSIF (p_moduletype = 34 ) THEN /* 34 = ds1 port on XTC or 15310*/
SELECT col200 INTO o_portname
WHERE nedbaccessid=p_nedbaccessid
AND physicalloc=p_physicalloc
AND objectindex in (204,340) /* 204=Ds1Line 340=Ds1LineModel */
AND moduletype in (47,233,234); /* 47=XTC 233=DS1_28_DS3_EC1_3
234=DS1_84_DS3_EC1_3 */
ELSIF (p_moduletype = 32 ) THEN /* 32 = ds3 port on XTC or 15310*/
SELECT col200 INTO o_portname
WHERE nedbaccessid=p_nedbaccessid
AND physicalloc=p_physicalloc
AND objectindex in (208,341) /* 208=Ds3Line 341=Ds3LineModel */
AND moduletype in (47,233,234); /* 47=XTC 233=DS1_28_DS3_EC1_3
234=DS1_84_DS3_EC1_3 */
ELSIF (p_moduletype = 102 or p_moduletype = 103 or p_moduletype = 163 or p_moduletype =
164 or p_moduletype = 187 ) THEN /* For ML series cards*/
SELECT col200 INTO o_portname
WHERE nedbaccessid=p_nedbaccessid
AND physicalloc=p_physicalloc
AND objectindex in (136,257);
SELECT col200 INTO o_portname
WHERE nedbaccessid=p_nedbaccessid
AND physicalloc=p_physicalloc
AND objectindex in (134,255);
SELECT col200 INTO o_portname
WHERE nedbaccessid=p_nedbaccessid
AND physicalloc=p_physicalloc
AND moduleType=p_moduletype
AND objectindex in
(106,109,114,115,121,122,123,125,134,136,141,142,143,147,169,184,185,193,196,198,204,206,2
08,209,216,252,254,255,257,267,271,281);
3.1.68 GetPortWithPIMPPM
Create or replace function getPortWithPimPpm (physicalloc in number)
SELECT trunc(mod(physicalloc,power(2,13))) INTO port from dual;
3.1.69 GetPosPortState
This function takes the topology type, NE ID, slot, and port numbers and returns the POS port state.
CREATE OR REPLACE function getPosPortState(topoType in number, neId in number, slotNo in
number, portNo in number)
select COL5 into state from EQPT_INFO_TABLE where NeDbAccessId = neId and
ObjectIndex = 166 and getSlot(physicalLoc) = slotNo and getPort(physicalLoc) =
portNo;
3.1.70 GetPosPortStateForRPR802
This function takes the topology type, NE ID, slot, and port numbers and returns the POS port state for 802.17 RPR topologies.
CREATE OR REPLACE function getPosPortStateForRPR802(topoType in number, neId in number,
slotNo in number, portNo in number)
select COL5 into state from EQPT_INFO_TABLE where NeDbAccessId = neId and
ObjectIndex = 284 and getSlot(physicalLoc) = slotNo and
END getPosPortStateForRPR802;
3.1.71 GetPPM
Create or replace function getPPM (physicalloc in number)
SELECT trunc(mod(trunc(physicalloc/power(2,10)),power(2,6))) INTO ppm from dual;
3.1.72 GetProtectMLCardInfo
This function is used of the ML-series card is preprovisioned.
CREATE OR REPLACE function getProtectMLcardInfo(NEDbId in number, Slot in number)
CardModule varchar2(256);
ProtectCard varchar2(256);
Select NESysID into SysId from Ne_Info_table where NeDbaccessID = NEDbId;
Select NEModelType into model from Ne_Info_table where NeDbaccessID = NEDbId;
Select EquipmentType into equipType from ONS15454_ne_inventory_table where
NeDbaccessID = NEDbId and getSlot(PhysicalLoc) = Slot;
Select ModuleName into CardModule from module_type_table where moduleType =
equipType and modelType = model;
ProtectCard := SysId || ':Slot ' || Slot || ' (' || CardModule || ')';
END getProtectMLcardInfo;
3.1.73 GetQoSPhLoc
CREATE OR REPLACE FUNCTION Getqosphloc(slot IN NUMBER, cardPhloc IN NUMBER)
IS PhLoc NUMBER(20); counter NUMBER;
PhLoc:=Getphysicallocwithpimppm(Getshelf(cardPhloc), slot, 255, 63, 0);
counter := countCosPh(PhLoc);
PhLoc:=Getphysicallocwithpimppm(Getshelf(cardPhloc), slot, 255, 63, 1);
END Getqosphloc; /show errors;
3.1.74 GetShelf
Create or replace function getShelf (physicalloc in number)
SELECT trunc(mod(trunc(physicalloc/power(2,32)),power(2,8))) INTO shelf from dual;
3.1.75 GetSlot
Create or replace function getSlot (physicalloc in number)
SELECT mod(trunc(physicalloc/power(2,24)),power(2,8)) INTO slot from dual;
3.1.76 GetSlotModuleName
create or replace function getSlotModuleName(p_nenodeid in number, p_moduletype in number)
o_modulename varchar2(64);
SELECT trunc(p_moduletype/power(2,16)) INTO p_slotmoduletype FROM dual;
IF (p_nenodeid=0 OR p_slotmoduletype=0) THEN
SELECT nemodeltype INTO i_modeltype
WHERE nenodeid=p_nenodeid;
SELECT ModuleName INTO o_modulename
WHERE moduletype=p_slotmoduletype
AND modeltype=i_modeltype;
3.1.77 GetSlotModuleType
create or replace function getSlotModuleType(p_moduletype in number)
SELECT trunc(p_moduletype/power(2,16)) INTO p_slotmoduletype FROM dual;
3.1.78 GetSpanTblCktSpanDestNodeId
CREATE or replace function getspantblCktSpanDestNodeId (CKTNODEIDIN number,CKTUNIQUEIDIN
number)return varchar2
cursor ctpspandestnodeidcursor is
where CKTNODEID=CKTNODEIDIN
and CKTUNIQUEID =CKTUNIQUEIDIN
ctpspandestnodeid_list varchar2(10000);
for rec in ctpspandestnodeidcursor loop
if ctpspandestnodeidcursor%ROWCOUNT = 1 then
ctpspandestnodeid_list:= rec.CKTCTPNODEID;
ctpspandestnodeid_list := ctpspandestnodeid_list||','||rec.CKTCTPNODEID;
return ctpspandestnodeid_list;
END getspantblCktSpanDestNodeId;
3.1.79 GetSpanTblCktSpanSrcNodeId
CREATE or replace function getspantblCktSpanSrcNodeId (CKTNODEIDIN number,CKTUNIQUEIDIN
number)return varchar2
cursor ctpspansrcnodeidcursor is
where CKTNODEID=CKTNODEIDIN
and CKTUNIQUEID=CKTUNIQUEIDIN
finalspansrcnodeid_list varchar2(10000);
for rec in ctpspansrcnodeidcursor loop
if ctpspansrcnodeidcursor%ROWCOUNT = 1 then
finalspansrcnodeid_list:= rec.CKTCTPNODEID;
finalspansrcnodeid_list := finalspansrcnodeid_list||','||rec.CKTCTPNODEID;
return finalspansrcnodeid_list;
END getspantblCktSpanSrcNodeId;
3.1.80 GetSubIf
Create or replace function getSubIf(neifindex in number)
i_neifindex := neifindex+power(2,32);
SELECT mod(trunc(i_neifindex/power(2,16)),power(2,16)) INTO subifindex FROM dual;
3.1.81 GetValidCktSecSrcNodeId
CREATE or replace function getValidCktSecSrcNodeId (CKTNODEIDIN number,CKTUNIQUEIDIN
number)return number
o_CktSedSrcNodeId number;
select CktCtpNodeId into o_CktSedSrcNodeId
where CktNodeId = CKTNODEIDIN
and CktUniqueId = CKTUNIQUEIDIN
return o_CktSedSrcNodeId;
END getValidCktSecSrcNodeId;
3.1.82 GetValidCktSrcNodeId
CREATE or replace function getValidCktSrcnodeid (CKTNODEIDIN number,CKTUNIQUEIDIN number)
o_ValidCktSrcnodeid number;
select CktCtpNodeId into o_ValidCktSrcnodeid
where CktNodeId = CKTNODEIDIN
and CktUniqueId = CKTUNIQUEIDIN
return o_ValidCktSrcnodeid;
END getValidCktSrcnodeid;
3.1.83 GetValidModelType
create or replace function getValidModelType (CktNodeIdIN number, CktUniqueIdIN number,
ctp_typeIN number)
select CKTCTPMODELTYPE into o_ValidModelType
where CktNodeId = CktNodeIdIN
and CktUniqueId = CktUniqueIdIN
and ctp_type = ctp_typeIN;
3.1.84 GetValidModuleType
create or replace function getValidModuleType (CktNodeIdIN number, CktUniqueIdIN number,
ctp_typeIN number)
o_ValidModuleType number;
select CKTCTPMODULETYPE into o_ValidModuleType
where CktNodeId = CktNodeIdIN
and CktUniqueId = CktUniqueIdIN
and ctp_type = ctp_typeIN;
return o_ValidModuleType;
3.1.85 GetValidObjectType
create or replace function getValidObjectType (CktNodeIdIN number, CktUniqueIdIN number,
ctp_typeIN number)return number
o_ValidObjectType number;
select CKTCTPOBJECTTYPE into o_ValidObjectType
where CktNodeId = CktNodeIdIN
and CktUniqueId = CktUniqueIdIN
and ctp_type = ctp_typeIN;
return o_ValidObjectType;
3.1.86 Has_Next
- used by function ne_belongs_to_APC_domain to determine if a node belongs to an APC
domain
CREATE OR REPLACE FUNCTION has_next
(base_string IN VARCHAR2,
start_looking_at IN INTEGER,
found_at_position OUT INTEGER,
token OUT VARCHAR2) RETURN BOOLEAN
-- add delimiters at the end of the base string
target := concat(base_string,looking_for);
-- find position of next delimiter
found_at_position := INSTR (target,looking_for,start_looking_at,1);
if found_at_position > start_looking_at then
token := SUBSTR(base_string,start_looking_at,found_at_position-start_looking_at);
RETURN (found_at_position <> 0);
3.1.87 IS_NUMBER
CREATE OR REPLACE function IS_NUMBER(str in varchar2, rv in number:=-1) return number IS
Exception WHEN OTHERS then
3.1.88 IsIPv6
function isIPV6 (NEDBid number)
select IS_IPV6 into isipv6 from ne_info_table where nedbaccessid = NEDBid;
3.1.89 MapObjectIndex
CREATE or replace function mapobjectIndex(neModelType number,
moduletype number) return number
elsif moduletype = 32 then
elsif moduletype = 31 then
elsif moduletype = 69 then
elsif moduletype = 32 then
elsif moduletype = 33 then
if (neModelType = 38 or neModelType = 39) and
(moduleType = 28 or moduleType = 29 or moduleType = 30) then
if (neModelType = 18 or neModelType = 30) and
(moduleType = 28 or moduleType = 29 or moduleType = 30) then
if moduleType = 9 or moduleType = 106 or moduleType = 10 or
moduleType = 11 or moduleType = 12 or moduleType = 13 or
moduleType = 28 or moduleType = 29 or moduleType = 30 or
moduleType =60 or moduleType = 85 or moduleType = 86 or moduleType = 87 or
moduleType = 113 then
elsif neModelType = 3 and moduleType = 4 then
elsif neModelType = 3 and moduleType = 5 then
elsif neModelType = 5 and moduleType = 4 then
elsif neModelType = 14 and moduleType = 4 then
elsif neModelType = 14 and moduleType = 5 then
elsif moduleType = 6 or moduleType = 7 or moduleType = 58 then
elsif moduleType = 57 then
elsif moduleType = 102 or moduleType = 103 then
elsif moduleType = 8 then
if nemodelIndex >= 61 then
elsif moduletype = 47 and portnumber <= 28 then
elsif moduletype = 47 and portnumber >28 then
elsif moduletype = 7 or moduletype = 8 then
elsif moduletype = 14 then
elsif moduletype = 15 then
elsif moduletype = 31 then
elsif moduletype = 32 then
elsif moduletype = 34 then
elsif moduletype = 62 then
elsif moduletype = 118 and portnumber = 1 then
elsif moduletype = 118 and portnumber = 2 then
elsif moduletype = 119 and portnumber >= 1 and portnumber <= 4 then
elsif moduletype = 119 and portnumber =5 then
elsif moduletype = 120 and portnumber = 1 then
elsif moduletype = 120 and portnumber = 2 then
elsif moduletype = 121 and portnumber = 1 then
elsif (moduletype = 121 and (portnumber = 2 or portnumber = 3)) then
elsif moduletype = 127 and portnumber = 1 then
elsif (moduletype = 127 and (portnumber = 2 or portnumber = 3)) then
elsif moduletype = 128 and portnumber = 1 then
elsif moduletype = 128 and portnumber >= 2 and portnumber <= 7 then
elsif moduletype = 129 and portnumber = 2 then
elsif (moduletype = 129 and (portnumber = 1 or portnumber = 3 or portnumber = 4)) then
elsif moduletype = 130 and portnumber = 6 then
elsif moduletype = 130 and portnumber >= 1 and portnumber <= 5 then
elsif moduletype = 131 and portnumber >= 1 and portnumber <= 32 then
elsif moduletype = 131 and portnumber = 33 then
elsif moduletype = 132 and portnumber >= 1 and portnumber <= 32 then
elsif moduletype = 132 and portnumber = 33 then
elsif moduletype = 133 and portnumber >= 1 and portnumber <= 8 then
elsif moduletype = 133 and (portnumber = 9 or portnumber = 10) then
elsif (moduletype = 134 and (portnumber = 1 or portnumber = 2)) then
elsif moduletype = 134 and portnumber >= 3 and portnumber <= 6 then
elsif moduletype = 135 and portnumber >= 1 and portnumber <= 4 then
elsif moduletype = 135 and portnumber >= 5 and portnumber <= 8 then
elsif moduletype = 136 and portnumber >= 1 and portnumber <= 8 then
elsif moduletype = 136 and portnumber >= 9 and portnumber <= 12 then
elsif moduletype = 137 and portnumber >= 1 and portnumber <= 2 then
elsif moduletype = 137 and portnumber >= 3 and portnumber <= 6 then
elsif moduletype = 138 and portnumber >= 1 and portnumber <= 8 then
elsif moduletype = 138 and portnumber >= 9 and portnumber <= 12 then
elsif moduletype = 143 then
elsif moduletype = 145 then
elsif moduletype = 163 or moduletype = 164 or moduletype = 187 or moduletype = 285 or
moduletype = 283 or moduletype = 284 then
elsif moduletype = 108 or moduletype = 83 or moduletype = 64 or moduletype = 65 or
moduletype =66 or
if nemodelindex = 33 then
elsif neModelType = 3 and moduleType = 218 then
elsif moduletype = 219 or moduletype = 253 or moduletype = 254 or moduletype = 220 then
elsif moduletype = 201 or moduletype = 202 or moduletype = 203 then
elsif moduletype = 204 then
elsif moduletype = 205 then
elsif moduletype = 206 or moduletype =207 or moduletype =208 then
elsif moduletype = 209 and portnumber<3 then
elsif moduletype = 209 and portnumber>=3 then
elsif moduletype = 210 or moduletype =211 then
elsif moduletype = 215 then
elsif moduletype = 183 and portnumber<9 then
elsif moduletype = 183 and portnumber>=9 then
elsif moduletype = 184 and portnumber<9 then
elsif moduletype = 184 and portnumber>=9 then
elsif moduletype = 181 then
elsif moduletype = 264 then
elsif moduletype = 265 then
elsif moduletype = 294 then
elsif moduletype = 295 then
elsif moduletype = 297 then
elsif moduletype =182 and portnumber<5 then
elsif moduletype =182 and portnumber=5 then
elsif moduletype = 271 and portnumber<3 then
elsif moduletype = 271 and portnumber>=3 then
elsif moduletype = 272 and portnumber<21 then
elsif moduletype = 272 and portnumber>=21 then
elsif moduletype = 273 and portnumber<17 then
elsif moduletype = 273 and portnumber>=17 then
elsif moduletype = 358 and portnumber<=1 then
elsif moduletype = 358 and portnumber>=2 then
elsif moduletype = 300 and portnumber<=1 then
elsif moduletype = 300 and portnumber>=2 then
elsif moduletype = 301 and portnumber<=4 then
elsif moduletype = 301 and portnumber>=5 then
elsif moduletype = 356 and portnumber<=4 then
elsif moduletype = 356 and portnumber>=5 then
elsif moduletype = 293 then
elsif moduletype = 248 and portnumber<9 then
elsif moduletype = 248 and portnumber>=9 then
elsif neModelType = 14 then
3.1.90 MergedInvalidityList
CREATE OR REPLACE function mergedInvalidityList(lineTableValue in integer,
lineInvalidityList in varchar2, pathInvalidityList in varchar2) return varchar2 as
TYPE column_name IS RECORD (
TYPE column_names IS TABLE OF column_name index by binary_integer;
column_list column_names;
tblName USER_TAB_COLUMNS.TABLE_NAME%TYPE;
dbColumnNo USER_TAB_COLUMNS.COLUMN_ID%TYPE;
value USER_TAB_COLUMNS.COLUMN_ID%TYPE;
mergedInvalidityList varchar2(100);
if(lineInvalidityList is null ) then
return pathInvalidityList;
if(length(trim(lineInvalidityList)) =0 ) then
return pathInvalidityList;
if(lineTableValue = -1) then
return pathInvalidityList;
tblName := 'ONS15454_SONET_LINE_PM_TABLE';
mergedInvalidityList := pathInvalidityList;
column_list(1).table_name := 'PPJCPDET';
column_list(1).view_name := 'PPJC_PDET';
column_list(2).table_name := 'NPJCPDET';
column_list(2).view_name := 'NPJC_PDET';
column_list(3).table_name := 'PPJCPGEN';
column_list(3).view_name := 'PPJC_PGEN';
column_list(4).table_name := 'NPJCPGEN';
column_list(4).view_name := 'NPJC_PGEN';
column_list(5).table_name := 'PJDIFF';
column_list(5).view_name := 'PJ_DIFF';
column_list(6).table_name := 'PJPSEC';
column_list(6).view_name := 'PJP_SEC';
column_list(7).table_name := 'PJNSEC';
column_list(7).view_name := 'PJN_SEC';
for recordNumber in 1..column_list.count loop
select column_id into dbColumnNo from USER_TAB_COLUMNS where table_name = tblName and
column_name = column_list(recordNumber).table_name;
offSet := instr(lineInvalidityList,':',1,occurence);
occurence := occurence + 1;
value := to_number(substr(lineInvalidityList,startPos,offSet-startPos),9999);
value := to_number(substr(lineInvalidityList,startPos +1,offSet-startPos
-1),9999);
if((dbColumnNo -1) = value) then
select column_id into dbColumnNo from USER_TAB_COLUMNS where
table_name='ONS15454_SONET_PATH_PM_TABLE' and
column_name=column_list(recordNumber).table_name;
mergedInvalidityList := mergedInvalidityList || (dbColumnNo -1) || ':';
if(mergedInvalidityList is null) then
return mergedInvalidityList;
3.1.91 NE_Belongs_to_APC_Domain
-- to determine if a node belongs to an APC domain
CREATE OR REPLACE FUNCTION ne_belongs_to_APC_domain
(sides IN VARCHAR2, neid in NUMBER) RETURN number
token varchar2(15):='-1';
neid_in_APC_domain varchar2(15):='-1';
found_in_token_at integer;
start_point integer := 1;
-- return value -1 menas that the NEDBID is not part of the domain
-- find if there is a next elemnt and assign the elemnt to token
(has_next(sides,',',start_point,found_at,token))
-- take from the elemnt the first part that is the NEDBID
if has_next(token,' ',1,found_in_token_at,neid_in_APC_domain) then
-- is the NEDBID we are looking fore
if to_number(neid_in_APC_domain) = neid then
-- if yes return it by the function...to be used in the where cluse of the
view
start_point := found_at + 1;
END ne_belongs_to_APC_domain;
3.1.92 RemoveFirstByteIf
CREATE or REPLACE function removefirstbyteif (neifindex in number)
i_neifindex := neifindex+power(2,32);
select mod(i_neifindex,power(2,24)) INTO o_neifindex from dual;
3.1.93 RemoveLowBits
CREATE OR REPLACE function removeLowBits (aNum number, numOfBits integer)
modVal := power (2, numOfBits);
result := trunc (aNum / modVal);
--result := result * modVal;
3.1.94 Time_Diff
CREATE or REPLACE FUNCTION time_diff (
DATE_1 IN DATE, DATE_2 IN DATE) RETURN NUMBER IS
-- Get Julian date number from first date (DATE_1)
NDATE_1 := TO_NUMBER(TO_CHAR(DATE_1, 'J'));
-- Get Julian date number from second date (DATE_2)
NDATE_2 := TO_NUMBER(TO_CHAR(DATE_2, 'J'));
-- Get seconds since midnight from first date (DATE_1)
NSECOND_1 := TO_NUMBER(TO_CHAR(DATE_1, 'SSSSS'));
-- Get seconds since midnight from second date (DATE_2)
NSECOND_2 := TO_NUMBER(TO_CHAR(DATE_2, 'SSSSS'));
RETURN (((NDATE_2 - NDATE_1) * 86400)+(NSECOND_2 - NSECOND_1));
3.1.95 TYPE AlarmInfoListType
--create or replace TYPE AlarmInfoListType as table of AlarmInfoType;
create TYPE AlarmInfoListType as table of AlarmInfoType;
3.1.96 TYPE AlarmInfoType
--create or replace TYPE AlarmInfoType as OBJECT (
create TYPE AlarmInfoType as OBJECT (
ActiveAlarmTimeStamp date,
ActiveAlarmSeverity number,
ActiveAlarmServEff number,
ActiveAlarmAdditionalInfo varchar2(512),
ActiveAlarmComment varchar2(2014),
ClearAlarmTimeStamp date,
NEAlarmClearTimeStamp date,
externalcondition varchar2(1024),
StrObjInstance VARCHAR2(256),
StrDirection VARCHAR2(6),
3.1.97 TYPE Link_Id_Tabtype
create or replace TYPE link_id_tabtype is Table of number;
--drop type AlarmInfoListType;
--drop type AlarmInfoType;