[sqlalchemy] deferrable constraints

2011-09-14 Thread Wichert Akkerman
Constraints marked as deferrable result in a syntax error when using SQLite. Is this deliberate, or a bug in the sqlite dialect? Regards, Wichert. -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to

Re: [sqlalchemy] deferrable constraints

2011-09-14 Thread Wichert Akkerman
On 09/14/2011 12:25 PM, Wichert Akkerman wrote: Constraints marked as deferrable result in a syntax error when using SQLite. Is this deliberate, or a bug in the sqlite dialect? As a workaround I figured I could use events to only add deferrable constraint variants on PostgreSQL and use the

[sqlalchemy] Error while using CAST

2011-09-14 Thread pravin battula
Hi, I'm using cast to update values in a table by issuing following command. table.update().values(empno = cast(empno,Integer)).execute(). Where as empno is an string field,i'm trying to convert the data from empno column from string to integer and then issuing the below command to alter the

[sqlalchemy] Re: Error while using CAST

2011-09-14 Thread pravin battula
Sorry for the spelling mistake.It shows an error as below. OperationalError: (OperationalError) (1292, Truncated incorrect INTEGER value: 'testing') 'UPDATE test.mytable SET `newColumn`=CAST(test.mytable.`empno` AS SIGNED INTEGER)' () On Sep 14, 6:48 pm, pravin battula pravin.batt...@gmail.com

Re: [sqlalchemy] Re: Error while using CAST

2011-09-14 Thread Mike Conley
Don't know what database you are using, but this looks like you are trying to cast the string 'testing' to an integer and the database engine says you can't do that. -- Mike Conley On Wed, Sep 14, 2011 at 9:51 AM, pravin battula pravin.batt...@gmail.comwrote: Sorry for the spelling

[sqlalchemy] Re: Error while using CAST

2011-09-14 Thread pravin battula
Hi Mike, I'm using Mysql 5.0 backend On Sep 14, 8:20 pm, Mike Conley mconl...@gmail.com wrote: Don't know what database you are using, but this looks like you are trying to cast the string 'testing' to an integer and the database engine says you can't do that. -- Mike Conley On Wed, Sep

[sqlalchemy] Multiple rows returning with uselist=False under load.

2011-09-14 Thread Justin Levine
Howdy -- We're running load tests against our Pylons application, which uses SQLAlchemy to hit an Oracle DB. Under load we're getting the following errors: [Tue Sep 13 12:10:45 2011] [error] /opt/wgen-3p/python26/lib/python2.6/ site-packages/sqlalchemy/orm/mapper.py:2113: SAWarning: Multiple

[sqlalchemy] Re: Error while using CAST

2011-09-14 Thread pravin battula
Mike, when i execute the below sql statement directly in the database using sqlyog,it works fine but when tried with sqlalchemy it didn't. update mytable set EmpMaster = cast(empno as UNSIGNED INTEGER) On Sep 14, 8:23 pm, pravin battula pravin.batt...@gmail.com wrote: Hi Mike, I'm using Mysql

Re: [sqlalchemy] Multiple rows returning with uselist=False under load.

2011-09-14 Thread Michael Bayer
On Sep 14, 2011, at 11:22 AM, Justin Levine wrote: Howdy -- We're running load tests against our Pylons application, which uses SQLAlchemy to hit an Oracle DB. Under load we're getting the following errors: [Tue Sep 13 12:10:45 2011] [error] /opt/wgen-3p/python26/lib/python2.6/

RE: [sqlalchemy] Re: Error while using CAST

2011-09-14 Thread King Simon-NFHD78
Does this work instead: table.update().values(empno = cast(table.c.empno,Integer)).execute() ie. a bare 'empno' inside your cast expression is just referring to a python variable 'empno', which you've probably set to the value 'testing' at some other point in your code. You need the column

[sqlalchemy] Re: Error while using CAST

2011-09-14 Thread pravin battula
Hi King, Thanks for the reply,I tried giving table.update().values(empno = cast(table.c.empno,Integer)).execute() but still the same the same error. OperationalError: (OperationalError) (1292, Truncated incorrect INTEGER value: 'testing') 'UPDATE test.mytable SET `empno`=CAST(test.mytable.`empno`