67 lines
3.0 KiB
Plaintext
67 lines
3.0 KiB
Plaintext
CREATE OR REPLACE TRIGGER EFT_NOM.cg$BUR_PARAMETERS
|
|
|
|
BEFORE UPDATE ON PARAMETERS FOR EACH ROW
|
|
DECLARE
|
|
cg$rec cg$PARAMETERS.cg$row_type;
|
|
cg$ind cg$PARAMETERS.cg$ind_type;
|
|
cg$old_rec cg$PARAMETERS.cg$row_type;
|
|
BEGIN
|
|
-- Application_logic Pre-Before-Update-row <<Start>>
|
|
-- Application_logic Pre-Before-Update-row << End >>
|
|
|
|
-- Load cg$rec/cg$ind values from new
|
|
|
|
cg$rec.CREATED_BY := :new.CREATED_BY;
|
|
cg$ind.CREATED_BY := (:new.CREATED_BY IS NULL AND :old.CREATED_BY IS NOT NULL )
|
|
OR (:new.CREATED_BY IS NOT NULL AND :old.CREATED_BY IS NULL)
|
|
OR NOT(:new.CREATED_BY = :old.CREATED_BY) ;
|
|
cg$PARAMETERS.cg$table(cg$PARAMETERS.idx).CREATED_BY := :old.CREATED_BY;
|
|
cg$rec.PARS_ID := :new.PARS_ID;
|
|
cg$ind.PARS_ID := (:new.PARS_ID IS NULL AND :old.PARS_ID IS NOT NULL )
|
|
OR (:new.PARS_ID IS NOT NULL AND :old.PARS_ID IS NULL)
|
|
OR NOT(:new.PARS_ID = :old.PARS_ID) ;
|
|
cg$PARAMETERS.cg$table(cg$PARAMETERS.idx).PARS_ID := :old.PARS_ID;
|
|
cg$rec.CODE := :new.CODE;
|
|
cg$ind.CODE := (:new.CODE IS NULL AND :old.CODE IS NOT NULL )
|
|
OR (:new.CODE IS NOT NULL AND :old.CODE IS NULL)
|
|
OR NOT(:new.CODE = :old.CODE) ;
|
|
cg$PARAMETERS.cg$table(cg$PARAMETERS.idx).CODE := :old.CODE;
|
|
cg$rec.NAME := :new.NAME;
|
|
cg$ind.NAME := (:new.NAME IS NULL AND :old.NAME IS NOT NULL )
|
|
OR (:new.NAME IS NOT NULL AND :old.NAME IS NULL)
|
|
OR NOT(:new.NAME = :old.NAME) ;
|
|
cg$PARAMETERS.cg$table(cg$PARAMETERS.idx).NAME := :old.NAME;
|
|
cg$rec.CATE_ID := :new.CATE_ID;
|
|
cg$ind.CATE_ID := (:new.CATE_ID IS NULL AND :old.CATE_ID IS NOT NULL )
|
|
OR (:new.CATE_ID IS NOT NULL AND :old.CATE_ID IS NULL)
|
|
OR NOT(:new.CATE_ID = :old.CATE_ID) ;
|
|
cg$PARAMETERS.cg$table(cg$PARAMETERS.idx).CATE_ID := :old.CATE_ID;
|
|
cg$rec.CREATED_ON := :new.CREATED_ON;
|
|
cg$ind.CREATED_ON := (:new.CREATED_ON IS NULL AND :old.CREATED_ON IS NOT NULL )
|
|
OR (:new.CREATED_ON IS NOT NULL AND :old.CREATED_ON IS NULL)
|
|
OR NOT(:new.CREATED_ON = :old.CREATED_ON) ;
|
|
cg$PARAMETERS.cg$table(cg$PARAMETERS.idx).CREATED_ON := :old.CREATED_ON;
|
|
|
|
|
|
cg$PARAMETERS.idx := cg$PARAMETERS.idx + 1;
|
|
|
|
if not (cg$PARAMETERS.called_from_package) then
|
|
cg$PARAMETERS.validate_arc(cg$rec);
|
|
cg$PARAMETERS.validate_domain(cg$rec, cg$ind);
|
|
cg$PARAMETERS.validate_domain_cascade_update(cg$old_rec);
|
|
|
|
cg$PARAMETERS.upd(cg$rec, cg$ind, FALSE);
|
|
cg$PARAMETERS.called_from_package := FALSE;
|
|
end if;
|
|
|
|
:new.CREATED_BY := cg$rec.CREATED_BY;
|
|
:new.CODE := cg$rec.CODE;
|
|
:new.NAME := cg$rec.NAME;
|
|
:new.CATE_ID := cg$rec.CATE_ID;
|
|
:new.CREATED_ON := cg$rec.CREATED_ON;
|
|
-- Application_logic Post-Before-Update-row <<Start>>
|
|
-- Application_logic Post-Before-Update-row << End >>
|
|
END;
|
|
/
|
|
|