-
Book Overview & Buying
-
Table Of Contents
MySQL for Python
By :
As seen earlier, MySQL's SELECT statement can be very greedy. Using fetchall() processes all hits in one go. However, as we will see in this chapter, there are times when you should avoid this.
In this chapter, we will look at the following:
Certain circumstances under which record-by-record processing is desirable
How iteration helps us get each record in turn
Using custom-created Python iterators for record-by-record processing
Using fetchone() to process one record at a time
Using fetchmany() to retrieve data in small chunks
How to use loops to walk through a series of records
At the end of the chapter, we will put these lessons to use for writing a program that works with returned data record-by-record.
Change the font size
Change margin width
Change background colour