spss.Cursor Methods (Python)

Each usage mode of the Cursor class supports its own set of methods, as shown in the table below.

Table 1. Usage modes for Cursor class methods
Method Read mode Write mode Append mode
AllocNewVarsBuffer   X  
close X X X
CommitCase   X X
CommitDictionary   X  
EndChanges     X
fetchall X X**  
fetchmany X X**  
fetchone X X  
GetCaseCount X X X
GetDataFileAttributeNames X X X
GetDataFileAttributes X X X
GetMultiResponseSetNames X X X
GetMultiResponseSet X X X
GetVarAttributeNames X X X
GetVarAttributes X X X
GetVariableCount X X X
GetVariableFormat X X X
GetVariableLabel X X X
GetVariableMeasurementLevel X X X
GetVariableName X X X
GetVariableRole X X X
GetVariableType X X X
GetVarMissingValues X X X
IsEndSplit X X  
reset X X X
SetFetchVarList X X  
SetOneVarNameAndType   X  
SetUserMissingInclude X X  
SetValueChar   X X
SetValueNumeric   X X
SetVarAlignment   X  
SetVarAttributes   X  
SetVarCMissingValues   X  
SetVarCValueLabel   X  
SetVarFormat   X  
SetVarLabel   X  
SetVarMeasureLevel   X  
SetVarNameAndType   X  
SetVarNMissingValues   X  
SetVarNValueLabel   X  
SetVarRole   X  

** This method is primarily for use in read mode.

Note

The Cursor class Get methods (for instance, GetCaseCount, GetVariableCount, and so on) listed above have the same specifications as the functions in the spss module of the same name. For example, the specifications for the Cursor method GetCaseCount are the same as those for the spss.GetCaseCount function. While a cursor is open, both sets of functions return information about the current cursor and give identical results. In the absence of a cursor, the spss module functions retrieve information about the active dataset. Refer to the entries for the corresponding spss module functions for specifications of these Cursor methods.