Subject | Question about update - trigger |
---|---|
Author | wasith zaki |
Post date | 2003-04-11T06:43:03Z |
What is the trigger code that will update PVI_ID in table TBADDRESS if
PVI_ID in table CITY changed.
I was try using this code but it doesn't seem to work. Thanks for your
help
CREATE TRIGGER T_TBCITY_UPVI_ID FOR TBCITY
ACTIVE AFTER UPDATE POSITION 0
AS
begin
IF (NEW.PVI_ID <> OLD.PVI_ID) THEN
UPDATE TBADDRESS SET TBADDRESS.PVI_ID=NEW.PVI_ID where
TBADDRESS.CIT_ID = NEW.CIT_ID;
End
TIA,
Wasith
PVI_ID in table CITY changed.
I was try using this code but it doesn't seem to work. Thanks for your
help
CREATE TRIGGER T_TBCITY_UPVI_ID FOR TBCITY
ACTIVE AFTER UPDATE POSITION 0
AS
begin
IF (NEW.PVI_ID <> OLD.PVI_ID) THEN
UPDATE TBADDRESS SET TBADDRESS.PVI_ID=NEW.PVI_ID where
TBADDRESS.CIT_ID = NEW.CIT_ID;
End
TIA,
Wasith