pypyodbc execute delete query error "Function sequence error"
<p>I was able to execute the delete SQL query in Python with pypyodbc as below</p>

<pre><code>cur.execute("delete from table_a where a ='a';").commit()
</code></pre>

<p>However, I failed to run the delete SQL with a subquery</p>

<pre><code>cur.execute("delete from table_a where a in ( select a from table_b );").commit() 
</code></pre>

<p>will return </p>

<pre><code>pypyodbc.Error: ('HY010', '[HY010] [unixODBC][Driver Manager]Function sequence error')
</code></pre>

<p>How could I run a delete SQL with subquery?</p>

<p>The cause of this issue is pypyodbc not work with the delete command that actually delete nothing.</p>

<p>If I run "delete from table_a where a ='a';" twice, first time it will success and second time return error.</p>

<p>To run delete command with subquery, I need to check whether subquery really have records.</p>

python sql vertica pypyodbc