Documentation Home
MySQL Connector/Python Developer Guide
Related Documentation Download this Manual
PDF (US Ltr) - 0.7Mb
PDF (A4) - 0.7Mb


10.5.21 MySQLCursor.statement Property

Syntax:

str = cursor.statement

This read-only property returns the last executed statement as a string. Thestatement property can be useful for debugging and displaying what was sent to the MySQL server.

The string can contain multiple statements if a multiple-statement string was executed. This occurs forexecute() withmulti=True. In this case, thestatement property contains the entire statement string and theexecute() call returns an iterator that can be used to process results from the individual statements. Thestatement property for this iterator shows statement strings for the individual statements.