MySQL Forums
Forum List  »  Connector/Python

Re: Python/Connect and Placeholders
Posted by: hai zhang
Date: May 03, 2013 12:50AM

I also came across the above issue. I was lucky to finally find the tip by myself for a long time. But, I got another interesting case which dose not need a ending comma. as follow is:

query_rows = ("select table_name,table_rows from tables "
"where table_schema=%s and table_rows > 1000000 "
"order by table_rows")
query_schemas = ("select table_schema from tables "
"where table_schema not in "
"('mysql','information_schema','performance_schema','test') "
"group by table_schema")

for schema in cursor_schemas:
cursor_rows.execute(query_rows, (schema))

I am new to python. I felt some kind of weird during using mysql-connector-python :(

Options: ReplyQuote

Written By
March 01, 2013 02:45AM
Re: Python/Connect and Placeholders
May 03, 2013 12:50AM

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.