title: SQLSTATE[HY010]: Function sequence error: 0 during insert
body: <h2>The problem</h2>
  
  <p>During a very simple insert query, using PDO with an ODBC driver for a DB2 database, the driver returns the following error:</p>
  
  <pre><code>SQLSTATE[HY010]: Function sequence error: 0 [Microsoft][Driver Manager ODBC] [italian message translation] (SQLExecute[0] at ext\pdo_odbc\odbc_stmt.c:254)
  </code></pre>
  
  <p>The query itself is a prepared statement insert, with strings and dates. [italian message translation] just says "Function sequence error" in italian.</p>
  
  <h2>The research</h2>
  
  <p><a href="https://stackoverflow.com/q/18215392/998759">This SO question</a> reports the same problem, but occurred during a SELECT query, which is not my case
  <a href="https://bugs.php.net/bug.php?id=40452" rel="nofollow noreferrer">This PHP bug report</a> reports the same problem, but I've determined that's not my case either.</p>
  
  <h2>The question</h2>
  
  <p>Why does a simple insert cause a function sequence error with SQLSTATE[HY010]?</p>