title: Sql trigger "column list not valid for this trigger type"
body: <p>So I want to create trigger:</p>
  
  <pre><code>CREATE TRIGGER add_primary_key
  AFTER INSERT ON CAJ
  FOR EACH ROW
  WHEN (ID_CAJ IS NULL)
  DECLARE
  maximum NUMBER;
  BEGIN
    maximum := SELECT MAX(ID_CAJ) FROM caj;
    if (maximum &lt;&gt; 0)
      UPDATE caj
      SET ID_CAJ = maximum + 1;
      WHERE CAJ_ID = NULL
      maximum = maximum +1;
  END;
  </code></pre>
  
  <p>This error appears:</p>
  
  <pre><code>"invalid NEW or OLD specification"
  *Cause:    An invalid NEW or OLD specification was given for a column.
  *Action:   Re-specify the column using the correct NEW or OLD specification.
  </code></pre>
  
  <p>Do you guys have any idea?</p>