reset Method (Python)
.reset(). Resets the cursor.
- This method is available in read, write, or append mode.
- In read and write modes, reset moves the record pointer to the first case, allowing multiple data passes. In append mode, it deletes the current cursor instance and creates a new one.
- When executing multiple data passes, the reset method must be called prior to defining new variables on subsequent passes. For an example, see the topic on write mode.
Example
import spss
cur=spss.Cursor()
data=cur.fetchall()
cur.reset()
data10=cur.fetchmany(10)
cur.close()