title: DatabaseError: ORA-00911: invalid character
body: <p>I have following code to execute sql quesry in Oracle db:</p>
  
  <pre><code>try:
      conn = cx_Oracle.connect(DB_LOGIN+"/"+DB_PWD+"@"+SID)
      cursor = connection.cursor()
      cursor.execute(sql)
      connection.commit()
      cursor.close()
      conn.close()
  except cx_Oracle.DatabaseError, ex:
      error, = ex.args
      print 'Error.code =', error.code
      print 'Error.message =' , error.message
      print 'Error.offset =', error.offset
      conn.rollback()
  </code></pre>
  
  <p>I got error: <code>DatabaseError: &lt;cx_Orac...40066758&gt;</code>.</p>
  
  <p>Why I don't see full error message in console? Looks like exception part is not executed. 
  I use python 2.5 and oracle 10.2.0 on linux.</p>
  
  <p>Update: After some investigation I found out that the error is <code>DatabaseError: ORA-00911: invalid character</code>.</p>
  
  <p>My sql string is like: <code>sql = "SELECT ID FROM TABLE WHERE DESC  = '" + str(desc[0]) + "';"</code>. This is generated string: <code>"SELECT ID FROM TABLE WHERE DESC  = '3312';"</code></p>
  
  <p>When I execute the same request in SQL Developer it works. So what I do wrong?</p>