MySQL Forums
Forum List  »  Connector/Python

Re: executemany statement with a subquery
Posted by: Andrii Nikitin
Date: October 22, 2012 07:23AM

That is wrong SQL syntax.
First test SQL in mysql client, then try to use it in python.

E.g.

self.__cursor.executemany(
"""INSERT INTO events (mainevent_id, eventtype_id, eventsubtype_id, period_id)
select id, %s, %s, %s from mainevents where first_competitor_id=%s and second_competitor_id=%s and league_id=%s and event_date=%s""",
event.type, event.subtype, event.period, event.id1, event.id2, event.league, event.date )

Options: ReplyQuote


Subject
Written By
Posted
Re: executemany statement with a subquery
October 22, 2012 07:23AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.