On 11/08/2015 05:58 AM, Ofir Herzas wrote: > Sqlalchemy 1.0.6 > > Trying to issue a simple select on a CLOB column, throws the following > exception: > > | > Traceback(most recent call last): > File"/opt/5.3/server/handlers/orm.py",line 81,inselect > > result =query.all() > > File"/opt/ve/python-2.7.6/lib/python2.7/site-packages/sqlalchemy/orm/query.py",line > 2399,inall > returnlist(self) > > File"/opt/ve/python-2.7.6/lib/python2.7/site-packages/sqlalchemy/orm/loading.py",line > 84,ininstances > util.raise_from_cause(err) > > File"/opt/ve/python-2.7.6/lib/python2.7/site-packages/sqlalchemy/util/compat.py",line > 199,inraise_from_cause > reraise(type(exception),exception,tb=exc_tb) > > File"/opt/ve/python-2.7.6/lib/python2.7/site-packages/sqlalchemy/orm/loading.py",line > 65,ininstances > fetch =cursor.fetchall() > > File"/opt/ve/python-2.7.6/lib/python2.7/site-packages/sqlalchemy/engine/result.py",line > 1243,infetchall > row =self.fetchone() > > File"/opt/ve/python-2.7.6/lib/python2.7/site-packages/sqlalchemy/engine/result.py",line > 1013,infetchone > self.cursor,self.context) > > File"/opt/ve/python-2.7.6/lib/python2.7/site-packages/sqlalchemy/engine/base.py",line > 1344,in_handle_dbapi_exception > util.reraise(*exc_info) > > File"/opt/ve/python-2.7.6/lib/python2.7/site-packages/sqlalchemy/engine/result.py",line > 1006,infetchone > returnself.process_rows([row])[0] > > File"/opt/ve/python-2.7.6/lib/python2.7/site-packages/sqlalchemy/engine/result.py",line > 929,inprocess_rows > forrow inrows] > > File"/opt/ve/python-2.7.6/lib/python2.7/site-packages/sqlalchemy/engine/result.py",line > 1204,in__init__ > row[index]=processor(row[index]) > > File"/opt/ve/python-2.7.6/lib/python2.7/site-packages/sqlalchemy/dialects/oracle/cx_oracle.py",line > 366,inprocess > returnvalue.read() > AttributeError:'str'objecthas noattribute 'read'
the SQL expression in question here is not a CLOB, you are likely reading from a VARCHAR field and/or SQL expression. If Oracle were returning a value that it considers to be a CLOB value, cx_oracle would return it as a cx_oracle.LOB object which is not the case here. > | > > > Is there any way around it? (other than not using Text columns) > > -- > You received this message because you are subscribed to the Google > Groups "sqlalchemy" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to sqlalchemy+unsubscr...@googlegroups.com > <mailto:sqlalchemy+unsubscr...@googlegroups.com>. > To post to this group, send email to sqlalchemy@googlegroups.com > <mailto:sqlalchemy@googlegroups.com>. > Visit this group at http://groups.google.com/group/sqlalchemy. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at http://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.