title: oci_execute(): OCI_SUCCESS_WITH_INFO: ORA-24344 using a trigger/sequence to auto increment an oracle table error
body: <p>I'm using a sequence and trigger to essentially auto increment a column in a table, however I'm getting an error - ORA-24344: success with compilation error.</p>
  
  <p>I was using this post: <a href="https://stackoverflow.com/questions/11296361/how-to-create-id-with-auto-increment-on-oracle">How to create id with AUTO_INCREMENT on Oracle?</a> and it worked successfully for two other tables w/ auto increment I made, but there must be something in here I'm not familiar with causing an error.</p>
  
  <p>More edits: Thanks to Polppan we've established that this likely isn't an Oracle issue, rather an OCI with PHP issue. I'm using: </p>
  
  <pre><code>oci_execute($sql);
  </code></pre>
  
  <p>And as mentioned <a href="http://board.phpbuilder.com/showthread.php?10254383-Creating-an-Oracle-trigger-using-ociexecute" rel="nofollow noreferrer">here</a> (again, thanks Polppan for that link), there's a bit of an issue between EOL characters and oci_execute. It was 11 years ago, so I don't know if that's been patched or not, and I did try his solution but it didn't help. Does anyone know if there are other issues with oci_execute and creating triggers?  </p>
  
  <p>Creating the table: (works)</p>
  
  <pre><code>CREATE TABLE RT_documents (
    documentID INT NOT NULL, 
    reviewID varchar2(20) NOT NULL, 
    file_location CLOB NOT NULL,
    version NUMBER(*,3) NOT NULL,
    CONSTRAINT RT_documents_pk PRIMARY KEY (documentID)
  )
  </code></pre>
  
  <p>Creating the sequence: (works)</p>
  
  <pre><code>CREATE SEQUENCE rt_documents_seq
  </code></pre>
  
  <p>Creating/replacing trigger: (doesn't work)</p>
  
  <pre><code>CREATE OR REPLACE TRIGGER rt_documents_bir
  BEFORE INSERT ON RT_documents
  FOR EACH ROW
  
  BEGIN
      SELECT RT_documents_seq.NEXTVAL
      INTO :new.documentID
      FROM dual;
  END;
  </code></pre>
  
  <p>EDIT: Exact error message as requested - (Note, I'm executing these query-by-query using OCI/Oracle in PHP. PHP tag added just in case, but pretty sure this is an oracle syntax error or something). </p>
  
  <p>Error:</p>
  
  <blockquote>
    <p>Notice: oci_execute(): OCI_SUCCESS_WITH_INFO: ORA-24344: success with
    compilation error in (...)</p>
  </blockquote>
  
  <p>-I can successfully execute the first two queries, and double checked and the table is there so it worked properly. </p>