git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@50874 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
CREATE OR REPLACE TRIGGER "EFT_NOM".cg$BUR_CONTACT_DETAILS
|
||||
|
||||
BEFORE UPDATE ON CONTACT_DETAILS FOR EACH ROW
|
||||
DECLARE
|
||||
cg$rec cg$CONTACT_DETAILS.cg$row_type;
|
||||
cg$ind cg$CONTACT_DETAILS.cg$ind_type;
|
||||
cg$old_rec cg$CONTACT_DETAILS.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$CONTACT_DETAILS.cg$table(cg$CONTACT_DETAILS.idx).CREATED_BY := :old.CREATED_BY;
|
||||
cg$rec.CODE_ID := :new.CODE_ID;
|
||||
cg$ind.CODE_ID := (:new.CODE_ID IS NULL AND :old.CODE_ID IS NOT NULL )
|
||||
OR (:new.CODE_ID IS NOT NULL AND :old.CODE_ID IS NULL)
|
||||
OR NOT(:new.CODE_ID = :old.CODE_ID) ;
|
||||
cg$CONTACT_DETAILS.cg$table(cg$CONTACT_DETAILS.idx).CODE_ID := :old.CODE_ID;
|
||||
cg$rec.DESCRIPTION := :new.DESCRIPTION;
|
||||
cg$ind.DESCRIPTION := (:new.DESCRIPTION IS NULL AND :old.DESCRIPTION IS NOT NULL )
|
||||
OR (:new.DESCRIPTION IS NOT NULL AND :old.DESCRIPTION IS NULL)
|
||||
OR NOT(:new.DESCRIPTION = :old.DESCRIPTION) ;
|
||||
cg$CONTACT_DETAILS.cg$table(cg$CONTACT_DETAILS.idx).DESCRIPTION := :old.DESCRIPTION;
|
||||
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$CONTACT_DETAILS.cg$table(cg$CONTACT_DETAILS.idx).CREATED_ON := :old.CREATED_ON;
|
||||
|
||||
|
||||
cg$CONTACT_DETAILS.idx := cg$CONTACT_DETAILS.idx + 1;
|
||||
|
||||
if not (cg$CONTACT_DETAILS.called_from_package) then
|
||||
cg$CONTACT_DETAILS.validate_arc(cg$rec);
|
||||
cg$CONTACT_DETAILS.validate_domain(cg$rec, cg$ind);
|
||||
cg$CONTACT_DETAILS.validate_domain_cascade_update(cg$old_rec);
|
||||
|
||||
cg$CONTACT_DETAILS.upd(cg$rec, cg$ind, FALSE);
|
||||
cg$CONTACT_DETAILS.called_from_package := FALSE;
|
||||
end if;
|
||||
|
||||
:new.CREATED_BY := cg$rec.CREATED_BY;
|
||||
:new.DESCRIPTION := cg$rec.DESCRIPTION;
|
||||
:new.CREATED_ON := cg$rec.CREATED_ON;
|
||||
-- Application_logic Post-Before-Update-row <<Start>>
|
||||
-- Application_logic Post-Before-Update-row << End >>
|
||||
END;
|
||||
/
|
||||
|
||||
Reference in New Issue
Block a user