title: Delete before delete trigger
body: <p>I have two tables:</p>
  
  <p>Table MASTER
  Table SLAVE with a column ID that always matches a MASTER.ID</p>
  
  <p>I would like to delete the SLAVE before deleting a MASTER through a DB2 trigger.
  Here's what I wrote:</p>
  
  <pre><code>CREATE TRIGGER delete_slave
  BEFORE DELETE ON MASTER
  REFERENCING OLD AS o FOR EACH ROW 
  DELETE FROM SLAVE WHERE ID = o.ID;
  </code></pre>
  
  <p>When I execute the query on a DB2 V10.5.0.3 database I get the following error:</p>
  
  <blockquote>
    <p>The trigger "SCHEMA1.DELETE_SLAVE" is defined with an unsupported
    triggered SQL statement.. SQLCODE=-797, SQLSTATE=42987, DRIVER=4.17.29
    SQL Code: -797, SQL State: 42987</p>
  </blockquote>
  
  <p>Could someone help me to identify what's wrong in the SQL statement that's triggered ?</p>
  
  <p>Thank you a lot in advance.</p>