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
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
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
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
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
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`