80 lines
2.9 KiB
Plaintext
80 lines
2.9 KiB
Plaintext
CREATE OR REPLACE TRIGGER EFT_NOM.cg$BIR_NETWORK_POINTS
|
|
|
|
BEFORE INSERT ON NETWORK_POINTS FOR EACH ROW
|
|
DECLARE
|
|
cg$rec cg$NETWORK_POINTS.cg$row_type;
|
|
cg$ind cg$NETWORK_POINTS.cg$ind_type;
|
|
BEGIN
|
|
-- Application_logic Pre-Before-Insert-row <<Start>>
|
|
-- Application_logic Pre-Before-Insert-row << End >>
|
|
|
|
-- Load cg$rec/cg$ind values from new
|
|
|
|
cg$rec.CREATED_BY := :new.CREATED_BY;
|
|
IF (:new.CREATED_BY IS NULL) THEN
|
|
cg$ind.CREATED_BY := FALSE;
|
|
ELSE
|
|
cg$ind.CREATED_BY := TRUE;
|
|
END IF;
|
|
cg$rec.NEPO_ID := :new.NEPO_ID;
|
|
cg$ind.NEPO_ID := TRUE;
|
|
cg$rec.CODE := :new.CODE;
|
|
cg$ind.CODE := TRUE;
|
|
cg$rec.NAME := :new.NAME;
|
|
cg$ind.NAME := TRUE;
|
|
cg$rec.STATUS := :new.STATUS;
|
|
cg$ind.STATUS := TRUE;
|
|
cg$rec.NEPO_TYPE := :new.NEPO_TYPE;
|
|
cg$ind.NEPO_TYPE := TRUE;
|
|
cg$rec.CREATED_ON := :new.CREATED_ON;
|
|
IF (:new.CREATED_ON IS NULL) THEN
|
|
cg$ind.CREATED_ON := FALSE;
|
|
ELSE
|
|
cg$ind.CREATED_ON := TRUE;
|
|
END IF;
|
|
|
|
if not (cg$NETWORK_POINTS.called_from_package) then
|
|
cg$NETWORK_POINTS.validate_arc(cg$rec);
|
|
cg$NETWORK_POINTS.validate_domain(cg$rec);
|
|
|
|
cg$NETWORK_POINTS.ins(cg$rec, cg$ind, FALSE);
|
|
cg$NETWORK_POINTS.called_from_package := FALSE;
|
|
end if;
|
|
|
|
cg$NETWORK_POINTS.cg$table(cg$NETWORK_POINTS.idx).CREATED_BY := cg$rec.CREATED_BY;
|
|
cg$NETWORK_POINTS.cg$tableind(cg$NETWORK_POINTS.idx).CREATED_BY := cg$ind.CREATED_BY;
|
|
|
|
cg$NETWORK_POINTS.cg$table(cg$NETWORK_POINTS.idx).NEPO_ID := cg$rec.NEPO_ID;
|
|
cg$NETWORK_POINTS.cg$tableind(cg$NETWORK_POINTS.idx).NEPO_ID := cg$ind.NEPO_ID;
|
|
|
|
cg$NETWORK_POINTS.cg$table(cg$NETWORK_POINTS.idx).CODE := cg$rec.CODE;
|
|
cg$NETWORK_POINTS.cg$tableind(cg$NETWORK_POINTS.idx).CODE := cg$ind.CODE;
|
|
|
|
cg$NETWORK_POINTS.cg$table(cg$NETWORK_POINTS.idx).NAME := cg$rec.NAME;
|
|
cg$NETWORK_POINTS.cg$tableind(cg$NETWORK_POINTS.idx).NAME := cg$ind.NAME;
|
|
|
|
cg$NETWORK_POINTS.cg$table(cg$NETWORK_POINTS.idx).STATUS := cg$rec.STATUS;
|
|
cg$NETWORK_POINTS.cg$tableind(cg$NETWORK_POINTS.idx).STATUS := cg$ind.STATUS;
|
|
|
|
cg$NETWORK_POINTS.cg$table(cg$NETWORK_POINTS.idx).NEPO_TYPE := cg$rec.NEPO_TYPE;
|
|
cg$NETWORK_POINTS.cg$tableind(cg$NETWORK_POINTS.idx).NEPO_TYPE := cg$ind.NEPO_TYPE;
|
|
|
|
cg$NETWORK_POINTS.cg$table(cg$NETWORK_POINTS.idx).CREATED_ON := cg$rec.CREATED_ON;
|
|
cg$NETWORK_POINTS.cg$tableind(cg$NETWORK_POINTS.idx).CREATED_ON := cg$ind.CREATED_ON;
|
|
|
|
cg$NETWORK_POINTS.idx := cg$NETWORK_POINTS.idx + 1;
|
|
|
|
:new.CREATED_BY := cg$rec.CREATED_BY;
|
|
:new.NEPO_ID := cg$rec.NEPO_ID;
|
|
:new.CODE := cg$rec.CODE;
|
|
:new.NAME := cg$rec.NAME;
|
|
:new.STATUS := cg$rec.STATUS;
|
|
:new.NEPO_TYPE := cg$rec.NEPO_TYPE;
|
|
:new.CREATED_ON := cg$rec.CREATED_ON;
|
|
|
|
-- Application_logic Post-Before-Insert-row <<Start>>
|
|
-- Application_logic Post-Before-Insert-row << End >>
|
|
END;
|
|
/
|
|
|