ERROR at line 2: PL/SQL: Statement ignored

11,672

You're missing a column name here "(name, surname, new_family_income)", as you are trying to insert 4 values into 3 columns.. I switched the statement, to not list out the columns, maybe that will help..

CREATE OR REPLACE TRIGGER log_family_increase
   AFTER UPDATE OF family_income
   ON student
   REFERENCING NEW AS new OLD AS old
   FOR EACH ROW
BEGIN
   INSERT INTO student_2 
        VALUES (:new.name,
                :new.surname,
                :new.family_income,
                'New INCOME');
END;
Share:
11,672
Mahmut Aoata
Author by

Mahmut Aoata

Updated on June 04, 2022

Comments

  • Mahmut Aoata
    Mahmut Aoata almost 2 years
     CREATE OR REPLACE TRIGGER log_FAMILY_increase
      AFTER UPDATE OF FAMILY_INCOME ON STUDENT
      FOR EACH ROW
     BEGIN
       INSERT INTO STUDENT_2 (NAME, SURNAME, NEW_FAMILY_INCOME)
       VALUES (:NEW.NAME,SURNAME, :NEW.FAMILY_INCOME, 'New INCOME');
     END;
    

    in oracle 10g i get this error message: ERROR at line 2: PL/SQL: Statement ignored