0

I am trying to update a table in one database from another using a trigger. I am getting the missing expression error which i am not able to figure out the reason why. The error is at the line :new.FO_CD != :old.FO_CD. I am also getting PL/SQL: SQL Statement ignored error at the line :new.END_DT != :old.END_DT OR. What might be causing these two errors?

CREATE OR REPLACE TRIGGER TRG_UPDATE_ITIN

AFTER DELETE OR UPDATE

ON FDL.PLA_ET 

REFERENCING NEW AS NEW OLD AS OLD 

FOR EACH ROW 

BEGIN 

IF DELETING THEN

UPDATE

    FMS.ITIN

SET

    PLN_ET_UUID = NULL

WHERE

    PLN_ET_UUID = :OLD.PLN_ET_UUID;

ELSIF UPDATING THEN

    IF
      :new.START_DT != :old.START_DT OR

       :new.END_DT != :old.END_DT OR

       :new.CREATED_DTTM != :old.CREATED_DTTM OR

       :new.CREATED_USER_ID != :old.CREATED_USER_ID OR

       :new.ACT_UUID != :old.ACT_UUID OR

       :new.FO_CD != :old.FO_CD

    THEN UPDATE FMS.ITIN

        SET

            START_DATE = :new.START_DT,

            END_DATE = :new.END_DT,

            CREATION_DATE = = :new.CREATED_DTTM,

            CREATED_BY_USER = :new.CREATED_USER_ID,

            ACT_UUID = :new.ACT_UUID,

            FO_CTL_NBR = :new.FO_CD

        WHERE

            PLN_ET_UUID = :new.PLN_ET_UUID;

     END IF;

END IF;

END;

1 Answer 1

2

This is wrong:

UPDATE fms.itin SET 
        start_date = :new.start_dt,
        end_date = :new.end_dt,
        creation_date = = :new.created_dttm,          --> here
        created_by_user = :new.created_user_id,

You've got two consecutive = = signs.


Maybe there are other errors, but without your tables, I can't run code you posted. Consider posting CREATE TABLE statement.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.