title: Derby SQL Update Trigger
body: <p>I am attempting to write an update trigger for a Derby database. The trigger needs to update the ODS_CNTRL_AUDIT table every time a change is made/ a new record is added to the ODS_CNTRL table. (This is in Oracle)</p>
  
  <p>So far I have </p>
  
  <pre><code>            create trigger Update_Audit
              after update 
                 on ODS_CNTRL
              for each row MODE DB2SQL
              insert into ODS_CNTRL_AUDIT
              (
              ODS_LOAD_ID, ODS_STATUS, USR_WWID, USR_FIRST_NM, 
              USR_LAST_NM, USR_DISPLAY_NM, USR_NT_ID,TOT_AMT
              )
              values
              (
              ODS_CNTRL.ODS_LOAD_ID, ODS_CNTRL.ODS_STATUS, ODS_CNTRL.USR_WWID, ODS_CNTRL.USR_FIRST_NM, 
              ODS_CNTRL.USR_LAST_NM, ODS_CNTRL.USR_DISPLAY_NM, ODS_CNTRL.USR_NT_ID, ODS_CNTRL.TOT_AMT, 
              T
              );
  </code></pre>
  
  <p>But this code will not run. I am receiving the error -</p>
  
  <pre><code>  "Error code -1, SQL state 42X04: Column 'ODS_CNTRL.ODS_LOAD_ID' is either not in any     table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then 'ODS_CNTRL.ODS_LOAD_ID' is not a column in the target table."
  </code></pre>
  
  <p>Do I need to add a For command? What edits need to be made for this trigger to work properly? All the values are columns in the ODS_CONTROL table.</p>