cx_oracle requires special type handling with BLOB.   You must pass full typing 
information to SQLAlchemy in order to have them handled directly.

The test case below doesn't make sense to me since "select(["dummy"])" would 
render "SELECT dummy FROM DUAL", which I didn't think was the same as "select * 
from dummy".    

In any case, if you are using textual SQL and need typing information, use the 
text() construct, 
http://www.sqlalchemy.org/docs/reference/sqlalchemy/expressions.html#sqlalchemy.sql.expression.text
 , specifying typemap and bindparams as appropriate.

text("select * from dummy where foo=:bar", bindparams=[bindparam('bar', 
type_=String)], typemap={'a':Binary, 'b':String})


On May 17, 2010, at 8:28 AM, dhanil anupurath wrote:

> Hi
> 
>  I am having a trouble with SA-oracle-Blob datatype.
>  Here I have a test program like this.
> 
>      import pkg_resources
>      pkg_resources.require("cx-Oracle>=5.0.3")
>      import cx_Oracle
>      import sqlalchemy
>      from sqlalchemy.sql import select
> 
>     db=sqlalchemy.create_engine('oracle://cse:c...@localhost')
>     conn = db.connect()
> 
>      result=conn.execute(select(["dummy"]))
>      print "helloooooooooooooo"
>      print result.fetchone()
> 
>      conn.close()
> 
>     cse is the username and password for ORACLE schema
> 
>    duumy is the table name ,it has a column with datatype BLob.
> 
>    For this am geting the result with the error,
> 
>    ORA-00932: inconsistent datatypes: expected NUMBER got BLOB
> 
>    Is there is any solution so that i do can do more complecated
>    select statements.
> 
>   Is Blob not supported for ORACLE-SA
> 
>   Any help is encouraged.
> 
>                                THANKS
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To post to this group, send email to sqlalch...@googlegroups.com.
> To unsubscribe from this group, send email to 
> sqlalchemy+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/sqlalchemy?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to