Hi!
Using cx_oracle and SQLAlchemy 0.6 I am having troubles with Oracle
objects (cx_Oracle.OBJECT) as function parameters. For example I have
a function that returns an object of type cx_Oracle.OBJECT, and now I
want to use that object as argument for a new function call:
>>> obj = session.scalar(func.SDO_GEOMETRY('POINT(0 0)', 4326))
2010-05-10 16:23:57,337 INFO sqlalchemy.engine.base.Engine.0x...b82c
SELECT SDO_GEOMETRY(:SDO_GEOMETRY_2, :SDO_GEOMETRY_3) AS
"SDO_GEOMETRY_1" FROM DUAL
2010-05-10 16:23:57,337 INFO sqlalchemy.engine.base.Engine.0x...b82c
{'SDO_GEOMETRY_2': 'POINT(0 0)', 'SDO_GEOMETRY_3': 4326}
>>> session.scalar(func.SDO_UTIL.TO_WKTGEOMETRY(obj))
[..]
File "/../env/lib/python2.6/site-packages/SQLAlchemy-0.6.0-py2.6.egg/
sqlalchemy/engine/default.py", line 277, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.NotSupportedError: (NotSupportedError)
Variable_TypeByValue(): unhandled data type cx_Oracle.OBJECT 'SELECT
SDO_UTIL.TO_WKTGEOMETRY(:TO_WKTGEOMETRY_2) AS "TO_WKTGEOMETRY_1" FROM
DUAL' {'TO_WKTGEOMETRY_2': <cx_Oracle.OBJECT object at 0x8e2f560>}
>>>
I tried to set a type using "bindparam", but that did not help:
>>> session.scalar(func.SDO_UTIL.TO_WKTGEOMETRY(bindparam('', wkt, type_=LargeBinary)))
What can I do?
Thanks,
Tobias
--
You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To post to this group, send email to
sqlal...@googlegroups.com.
To unsubscribe from this group, send email to
sqlalchemy+...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en.