Re: [sqlalchemy] NotSupportedError

2012-04-19 Thread jose soares
Yes, now it works, thanks a lot Michael. :-) j Michael Bayer wrote: func.cast() is not correct. Use the cast() function which handles this special syntax: from sqlalchemy import cast, Integer from sqlalchemy.sql import column from sqlalchemy.dialects import oracle print cast(column('x'),

[sqlalchemy] NotSupportedError

2012-04-18 Thread jo
Hi all, Someone could help me with this query? SELECT MAX(CAST(SUBSTR(codice_aziendale, 2) AS INTEGER)) FROM azienda WHERE codice_aziendale LIKE '#%%' AND REGEXP_LIKE(SUBSTR(codice_aziendale, 2) , '[[:digit:]]') I'm trying in this way:

Re: [sqlalchemy] NotSupportedError

2012-04-18 Thread Michael Bayer
we would need to know what database you're using. It's likely your DB doesn't support REGEXP_LIKE. On Apr 18, 2012, at 4:00 AM, jo wrote: Hi all, Someone could help me with this query? SELECT MAX(CAST(SUBSTR(codice_aziendale, 2) AS INTEGER)) FROM azienda WHERE codice_aziendale LIKE

Re: [sqlalchemy] NotSupportedError

2012-04-18 Thread jo
I'm using oracle. The error exists even without REGEXP_LIKE: session.query(sa.func.max(sa.func.cast(sa.func.substr(Azienda.c.codice_aziendale,2), sa.Integer))).scalar() NotSupportedError: (NotSupportedError) Variable_TypeByValue(): unhandled data type Integer 'SELECT

Re: [sqlalchemy] NotSupportedError

2012-04-18 Thread Michael Bayer
func.cast() is not correct. Use the cast() function which handles this special syntax: from sqlalchemy import cast, Integer from sqlalchemy.sql import column from sqlalchemy.dialects import oracle print cast(column('x'), Integer).compile(dialect=oracle.dialect()) CAST(x AS INTEGER) On Apr

[sqlalchemy] (NotSupportedError) Variable_TypeByValue(): unhandled data type cx_Oracle.OBJECT

2010-05-10 Thread Tobias
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 =

Re: [sqlalchemy] (NotSupportedError) Variable_TypeByValue(): unhandled data type cx_Oracle.OBJECT

2010-05-10 Thread Michael Bayer
the first step here would be to create a cx_oracle -only application that issues your query and gets the right result back.then we can make sure sqlalchemy is passing that along in the same way. The error you are seeing is generated by cx_oracle (SQLA just wraps the NotSupportedError).