You've helped me before with a similar situation but I just can't get this one working.
When a clinic_number gets changed in table_A, the clinic_name also needs to get updated (unless the clinic_number gets changed to '000'.) Table_B contains clin_num and clin_name. I've tried many variations and they just don't work. Can you help me again?
Thanks.
CREATE OR REPLACE TRIGGER TR_CLINIC_NAME
AFTER UPDATE OF CLINIC_NUMBER ON PATIENT_DATA
REFERENCING OLD AS OLD NEW AS NEW
FOR EACH ROW
BEGIN
IF :NEW.CLINIC_NUMBER <> '000'
THEN
:NEW.WARD := (SELECT CLIN_NAME FROM CLINIC_DATA
WHERE
:NEW.CLINIC_NUMBER := CLINIC_DATA.CLIN_NUM)
END IF;
END;
When a clinic_number gets changed in table_A, the clinic_name also needs to get updated (unless the clinic_number gets changed to '000'.) Table_B contains clin_num and clin_name. I've tried many variations and they just don't work. Can you help me again?
Thanks.
CREATE OR REPLACE TRIGGER TR_CLINIC_NAME
AFTER UPDATE OF CLINIC_NUMBER ON PATIENT_DATA
REFERENCING OLD AS OLD NEW AS NEW
FOR EACH ROW
BEGIN
IF :NEW.CLINIC_NUMBER <> '000'
THEN
:NEW.WARD := (SELECT CLIN_NAME FROM CLINIC_DATA
WHERE
:NEW.CLINIC_NUMBER := CLINIC_DATA.CLIN_NUM)
END IF;
END;