title: Python cx_Oracle bind variables
body: <p>I am a Python newbie, I am having troubles in the use of bind variables. If I execute the code below everything works fine.</p>
  
  <pre><code>bind= {"var" : "ciao"}
  sql = "select * from sometable where somefield = :bind"
  cur.prepare(sql)
  cur.execute(sql,bind)
  </code></pre>
  
  <p>Instead if I add another bind variable I obtain an error.</p>
  
  <pre><code>bind= {"var" : "ciao"}
  sql = "select * from sometable where somefield = :bind and otherfield = :bind"
  cur.prepare(sql)
  cur.execute(sql,(bind,bind))
  
  cur.execute(sql,(bind,bind))
  Oracle.NotSupportedError: Variable_TypeByValue(): unhandled data
  </code></pre>
  
  <p>I have solved it with</p>
  
  <pre><code>cur.execute(sql,(bind["var"],bind["var"]))
  </code></pre>
  
  <p>but I can't understand why the previous command was not ok.</p>
  
  <p>Which is the correct way to use bind variables? I am using cx_Oracle.</p>