title: Turning off automatic conversion to Decimal in SqlAlchemy with Oracle DB
body: <p>How do I tell SqlAlchemy <em>not</em> to convert Oracle Number fields to Decimal when querying an Oracle database?</p>
  
  <p>I'm trying to replace a bunch of code containing hand-rolled sql-statements, with SqlAlchemy.  A lot of the queries deal get 500 columns of Numbers from the database.  The SQL alchemy version, using their pooled connection, is 10 times slower, almost certainly because of the conversion to Decimal.</p>
  
  <pre><code>&gt;&gt;&gt; engine = sqlalchemy.create_engine("oracle+cx_oracle://"+connString)
  &gt;&gt;&gt; conn = engine.pool.connect()
  &gt;&gt;&gt; cursor = conn.cursor()
  &gt;&gt;&gt; cursor.execute("""SELECT * FROM MY_TABLE""")
  &gt;&gt;&gt; r = cursor.fetchone()
  &gt;&gt;&gt; r[-1]
  Decimal('0.878935370620606')
  </code></pre>
  
  <p>How do I tell the dialect not to make the conversion to Decimal?  (The old code doesn't use decimal, so the loss in precision isn't important.  The factor of 10 slowdown is.)</p>