MySQL Forums
Forum List  »  Connector/Python

Re: Cannot commit a read statement
Posted by: Oscar Pacheco
Date: July 27, 2022 07:54AM

Hello Xiang,

Yes, the behavior is expected. Here is a quick description of the commit() method:

https://dev.mysql.com/doc/connector-python/en/connector-python-api-mysqlconnection-commit.html

As you can see, commit() does not return any content and it is used to commit the current transaction. You can use the cur.fetchall() command to load the results.

See https://dev.mysql.com/doc/connector-python/en/connector-python-api-mysqlcursor-fetchall.html

Options: ReplyQuote


Subject
Written By
Posted
Re: Cannot commit a read statement
July 27, 2022 07:54AM


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.