Hi Guys,

I am trying to do this simple update query :

s=select([table1.c.mo_id],and_(table1.c.msisdn=="123",table2.c.mo_id==table1.c.mo_id))
s2=table2.update(table2.c.mo_id.in_(s),values={"Del":"tut"})

against MySQL. running sqlAlchemy 0.35. I get the following error :

(OperationalError) (1093, "You can't specify target table 'table2' for
update in FROM clause")

the generated SQL is :

UPDATE table2 SET del=%s WHERE table2.mo_id IN (SELECT table1.mo_id
FROM table1 table2
WHERE table1.msisdn = %s AND table2.mo_id = table1.mo_id)

The problem seems to be that in the FROM table2 is used which is not
allowed by MySQL.
If i do a select instead of an update, table2 does not show up ..
Could it be a bug in the update implementation ??

Thanks in advance

Sebastien


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to