Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Why does my relationship conflict with my trigger?

Why does my relationship conflict with my trigger?

From: David Bradley <davidbradley_at_home.com>
Date: Sun, 28 Jan 2001 17:03:43 GMT
Message-ID: <PhYc6.127331$ge4.45673433@news2.rdc2.tx.home.com>

I cannot understand why the following trigger worked fine until I added the relationship below. I have tried changing it to an AFTER UPDATE trigger and that does not seem to work either. Could someone let me know what would cause this and
what my solution should be.

Thanks,

David

Trigger



CREATE OR REPLACE TRIGGER "TSS".UT_PERSONNEL BEFORE UPDATE ON "TSS"."STI_PERSONNEL"
REFERENCING OLD AS OLD NEW AS NEW
FOR EACH ROW
BEGIN /* Handle the first name change. */
IF :NEW.FNAME != :OLD.FNAME THEN
INSERT INTO TSS.STI_PERSONNEL_HISTORY
(ID,PERSONNEL_ID,CHANGE_DATE,OLD_VALUE,NEW_VALUE,DESCRIPTION) VALUES TSS.SEQ_PERSONNEL_HISTORY_ID.NEXTVAL,:OLD.ID,SYSDATE,:OLD.FNAME,:NEW.FNAME,' FIRST NAME CHANGE');
END IF; END; Relationship

ALTER TABLE TSS.STI_PERSONNEL_HISTORY
 DROP CONSTRAINT STI_PERS_HISTORY_PERSID; ALTER TABLE TSS.STI_PERSONNEL_HISTORY
 ADD( CONSTRAINT STI_PERS_HISTORY_PERSID  FOREIGN KEY( PERSON_ID )
 REFERENCES TSS.STI_PERSONNEL(ID)
 ON DELETE CASCADE ); Received on Sun Jan 28 2001 - 11:03:43 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US