oh thats small.."func" already has an "in_", its just the determination of the "type" of the expression was looking at the "in" list which doesnt have a "type" attribute. I changed it so the "func" side of the equation determines the type, rev 1020.

btw, the type of the expression below is just NullTypeEngine type. if you wanted the real type to be involved, youd say:

        sql.func.substring(enatttr.c.val, 4, 7, type=types.String).in_(p1, p2)


On Feb 22, 2006, at 8:13 PM, Rick Morrision wrote:

I'm having trouble with a construct like:

SELECT fname FROM names WHERE SUBSTRING(tel, 4, 7) IN ('5551212', '4443333')

The construct:

sql.func.substring(entattr.c.val,4,7).in_(p1, p2)

throws an error.

I've looked into creating a freestanding in_ function in sql.py, which is messy -- looks like one can't prevent someone from using multiple clauses on the left side of the IN (which would be invalid SQL), and into extending the Function() class with an .in_ function, which so far has been inscrutable to me.

Can anyone suggest a different construct, or how to attack that Function() class?

Thx,
Rick




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to