[sqlalchemy] Re: padding of CHAR fields, inconsistent where clause; Oracle example

2009-10-08 Thread volx
All has been working fine in 0.6, Mike. Thanks. Out of curiosity how do you unit test against Oracle. Do you use some kind of mock object? On Oct 4, 10:01 am, Michael Bayer mike...@zzzcomputing.com wrote: On Oct 3, 2009, at 5:18 PM, volx wrote: Hi Mike: Thank you for that. I will try

[sqlalchemy] Re: padding of CHAR fields, inconsistent where clause; Oracle example

2009-10-08 Thread Michael Bayer
volx wrote: All has been working fine in 0.6, Mike. Thanks. Out of curiosity how do you unit test against Oracle. Do you use some kind of mock object? the test suite has --db and --dburi options that allow any URI to be used for tests. i.e. nosetests --dburi

[sqlalchemy] Re: padding of CHAR fields, inconsistent where clause; Oracle example

2009-10-04 Thread Michael Bayer
On Oct 3, 2009, at 5:18 PM, volx wrote: Hi Mike: Thank you for that. I will try it out on Monday. I see there is a major refactoring around types in version 0.6. One would be expected to define table classes with generic SQL types like CHAR or generic language types like String and not

[sqlalchemy] Re: padding of CHAR fields, inconsistent where clause; Oracle example

2009-10-03 Thread Michael Bayer
On Oct 2, 2009, at 6:05 PM, volx wrote: My module is called sandbox.py After importing it to ipython and letting it run, here's what I get for the test you suggested: In [47]: (sandbox.price_sources.c.desciption=='EJV').right.type Out[47]: OracleChar(length=100, convert_unicode=False,

[sqlalchemy] Re: padding of CHAR fields, inconsistent where clause; Oracle example

2009-10-03 Thread volx
Hi Mike: Thank you for that. I will try it out on Monday. I see there is a major refactoring around types in version 0.6. One would be expected to define table classes with generic SQL types like CHAR or generic language types like String and not with dialect implementations like OracleChar. Am

[sqlalchemy] Re: padding of CHAR fields, inconsistent where clause; Oracle example

2009-10-02 Thread volx
My module is called sandbox.py After importing it to ipython and letting it run, here's what I get for the test you suggested: In [47]: (sandbox.price_sources.c.desciption=='EJV').right.type Out[47]: OracleChar(length=100, convert_unicode=False, assert_unicode=None) The trouble that for some

[sqlalchemy] Re: padding of CHAR fields, inconsistent where clause; Oracle example

2009-10-01 Thread volx
Micheal: Thanks for your help thus far. Unfortunately I don't think the get_dbapi_type method gets called. From reading your code I see how it should be called from pre_exec - setinputsizes - get_dbapi_type but empirical evidence shows otherwise. Here's my little harness: import

[sqlalchemy] Re: padding of CHAR fields, inconsistent where clause; Oracle example

2009-10-01 Thread Michael Bayer
volx wrote: Micheal: Thanks for your help thus far. Unfortunately I don't think the get_dbapi_type method gets called. From reading your code I see how it should be called from pre_exec - setinputsizes - get_dbapi_type but empirical evidence shows otherwise. Here's my little harness:

[sqlalchemy] Re: padding of CHAR fields, inconsistent where clause; Oracle example

2009-10-01 Thread volx
Here's my program, modified as you suggest. It also creates the table so you can try it on any instance of Oracle. No joy on the result. Seems like the set_inputsizes isn't called? How can I tell for certain? import sqlalchemy.types as sqltypes from exceptions import NotImplementedError class

[sqlalchemy] Re: padding of CHAR fields, inconsistent where clause; Oracle example

2009-10-01 Thread Michael Bayer
volx wrote: Here's my program, modified as you suggest. It also creates the table so you can try it on any instance of Oracle. No joy on the result. Seems like the set_inputsizes isn't called? How can I tell for certain? import sqlalchemy.types as sqltypes from exceptions import

[sqlalchemy] Re: padding of CHAR fields, inconsistent where clause; Oracle example

2009-09-30 Thread Michael Bayer
On Sep 30, 2:07 pm, volx victor.o...@gmail.com wrote: Hello all: Consider table: CREATE TABLE PRICE_SOURCES (    ID decimal(22) PRIMARY KEY NOT NULL,    DESCRIPTION char(100) NOT NULL ) and this screen dump from ipython session: In [28]: import cx_Oracle In [29]: from

[sqlalchemy] Re: padding of CHAR fields, inconsistent where clause; Oracle example

2009-09-30 Thread volx
I have just now and it looks that this post probably belongs on cx_Oracle mailing list. In [47]: cursor.execute(select * from price_sources where desciption = :someparam, dict(someparam='EJV')).fetchall() Out[47]: [] In [49]: cursor.execute(select * from price_sources where desciption =

[sqlalchemy] Re: padding of CHAR fields, inconsistent where clause; Oracle example

2009-09-30 Thread volx
cx_Oracle actually has thread on that a topic at http://sourceforge.net/mailarchive/message.php?msg_id=47BED8B8.3983.00E5.0%40uwinnipeg.ca It boils down to having to specify a type for input parameter. Is that something I could plug-in as a decorator or would that need to be hacked on SqlAlchemy

[sqlalchemy] Re: padding of CHAR fields, inconsistent where clause; Oracle example

2009-09-30 Thread volx
I missed one important statement - prepare must be called on the query: query = select * from price_sources where description = :someparam cursor.prepare(query) cursor.setinputsizes(dict(someparam=cx_Oracle.FIXED_CHAR)) cursor.execute(query, dict(someparam='EJV')).fetchall() On Sep 30, 3:07 pm,

[sqlalchemy] Re: padding of CHAR fields, inconsistent where clause; Oracle example

2009-09-30 Thread Michael Bayer
volx wrote: cx_Oracle actually has thread on that a topic at http://sourceforge.net/mailarchive/message.php?msg_id=47BED8B8.3983.00E5.0%40uwinnipeg.ca It boils down to having to specify a type for input parameter. Is that something I could plug-in as a decorator or would that need to be