title: php oci: uncommitted foreign key needed for insert
body: <h2>So my situation is:</h2>
  <h2>I have 2 tables:</h2>
  <ul>
  <li>TABLE_A</li>
  <li>TABLE_B</li>
  </ul>
  <hr>
  <ul>
  <li>TABLE_A has an ID as Primary key as an identity</li>
  <li>TABLE_B has an ID as identity and a_ID as Foreign key Referencing the ID from TABLE_A</li>
  </ul>
  <hr>
  <p>I use oci_execute with OCI_NO_AUTO_COMMIT so if an insert fails later on, the inserts simply wont happen. And if everyting runs successfully I make a commit at the end;</p>
  <h3>The Problem</h3>
  <p>I run an insert on TABLE_A that returns the inserted rows ID that I want to use righ after.
  But since it hasn't been committed yet I get a foreign key violation error.</p>
  <h3>Possible solution</h3>
  <ul>
  <li>I thought of doing a prewritten PL/SQL script but I may run multiple inserts so I would end up string replacing and concatenating multiple inserts strins instead of properly binding variables.</li>
  <li>I even thought of inserting the row anyways and deleting if something fails but that sounds so bad, I'd rather do the string query manipulation.</li>
  <li>Maybe TABLE_A should have a 0 ID that nothing uses and I first use that. Than later on I change it to the inserted one but this sounds horrible as well.</li>
  </ul>
  <h3>Is there any other way I could do this?</h3>