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'),
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:
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
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
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
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 =
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).