title: Inserting a CLOB using cx_Oracle
body: <p>I am trying to insert a CLOB using the following code.</p>
  
  <pre><code>cursor = connection.cursor()
  cursor.setinputsizes(HERP = cx_Oracle.CLOB)
  
  cursor.execute("INSERT INTO myTable (FOO, BAR) VALUES (:FOO, :BAR)", FOO=val1, BAR=val2)
  cursor.execute("INSERT INTO myTable2 (HERP) VALUES (:HERP)", HERP=val3) 
  #len(HERP) 39097
  </code></pre>
  
  <p>When I run the script WITHOUT <code>cursor.setinputsizes(HERP = cx_Oracle.CLOB)</code> it fails on the second query WITH <code>ValueError: string data too large</code>, when I run the script with <code>cursor.setinputsizes(HERP = cx_Oracle.CLOB)</code> it fails on the first query with <code>DatabaseError: ORA-01036: illegal variable name/number</code>. The CLOB I am trying to insert contains a code snippet (i.e. it has a lot of semi colons, commas and parenthesis), <code>"string".decode("ascii")</code> returns <code>u'string'</code>, so unicode isn't the problem... right? I don't know if either of these things are problems. The field in the database is a currently a CLOB, however I have tried it with an NCLOB and the behavior did not change.</p>
  
  <p>I have also tried the field as a BLOB and then used <code>.encode("hex")</code> on the value I was inserting, again same behavior.</p>
  
  <p>I have also tried <code>HERP = cursor.var(cx_Oracle.CLOB)</code> instead of <code>cursor.setinputsizes(HERP = cx_Oracle.CLOB)</code>, same issues.</p>
  
  <p>I've been going through the discussions on the <a href="http://comments.gmane.org/gmane.comp.python.db.cx-oracle/2302" rel="noreferrer">cx-oracle-users</a> list, but no luck yet.</p>
  
  <p>It works if I use this line <code>cursor.execute("INSERT INTO myTable2 (HERP) VALUES (:HERP)", HERP="".join(set(val3)).encode("hex"))</code>, so I don't think it's an issue with the data's content (This is with the BLOB).</p>
  
  <p>How can I use <code>cx_Oracle</code> to insert a CLOB into an Oracle database?</p>