title: create trigger that delete and update data in other table
body: <p>i have 2 tables. I need to write a trigger IN PL/SQL that any time update or delete OF PROJCODE in TABLE 1(assignment) , UPDATE CODE in project and remove code from project that it doesn't appear any more in table1. THEN PRINT OUT THE COLUM (CODE) IN PROJECT TABLE</p>
  
  <p>I tried to write this code but still get error that code doesnt declare and :new.code and :old.code are bad bind variable 'OLD.CODE'!</p>
  
  <pre><code>CREATE OR REPLACE TRIGGER update_1
    BEFORE UPDATE OR DELETE OF PROJCODE
    ON ASSIGNMENT
    FOR EACH ROW
  BEGIN
    IF UPDATING THEN
      UPDATE PRODUCT P
      SET P.CODE = :new.CODE
      WHERE P.CODE = :old.CODE;
    ELSE
       DELETE FROM PROJECT WHERE :old.CODE= CODE ;
    END IF;
       DBMS_OUTPUT.PUT_LINE(CODE);
  END;
  </code></pre>
  
  <p>How can I solved this?</p>