This class is inheriting from
cursor.MySQLCursor and if needed automatically
retrieves rows after an operation has been executed.
MySQLCursorBuffered can be useful in situations
where two queries, with small result sets, need to be combined or
computed with each other.
You can either use the buffered argument when
using the connection's
cursor() method, or you can use the
buffered
connection
option to make all created cursors by default buffering.
import mysql.connector cnx = mysql.connector.connect() # Only this particular cursor will be buffering results cursor.cursor(buffered=True) # All cursors are by default buffering cnx = mysql.connector.connect(buffered=True)
See Section 21.6.5.1, “Tutorial: Raise Employee's Salary Using a Buffering Cursor” for a practical use case.

User Comments
Add your own comment.