title: Oracle Trigger before delete
body: <p>I'm trying to add a trigger before deleting a user (from a users(id, name,...) table) so I can also delete the user's phone numbers (from a user_phone(user_id, phone) table):</p>
  
  <pre><code>CREATE TRIGGER users_before_delete 
  BEFORE DELETE 
     ON users
     FOR EACH ROW
  BEGIN
     DELETE FROM user_phones WHERE user_id = :old.id;
  END;
  /
  </code></pre>
  
  <p>However I'm getting this error: <em>Warning: Trigger created with compilation errors.</em></p>
  
  <p>I think it has something to do with :old.id ? </p>
  
  <p><strong>EDIT:</strong>
  Even with the warning it seems to be working. When I delete a users, it also deletes its phone numbers.</p>
  
  <p>Thanks.</p>