AllocNewVarsBuffer Method (Python)
.AllocNewVarsBuffer(bufSize). Specifies the buffer size, in bytes, to use when adding new variables in the context of multiple data passes. The argument bufSize is a positive integer large enough to accommodate all new variables to be created by a given write cursor. Each numeric variable requires eight bytes. For each string variable, you should allocate a size that is an integer multiple of eight bytes, and large enough to store the defined length of the string (one byte per character). For example, you would allocate eight bytes for strings of length 1–8 and 16 bytes for strings of length 9–16.
- This method is only available in write mode.
-
AllocNewVarsBuffer
is required in the case of multiple data passes when you need to add variables on a data pass other than the first. When used, it must be called before reading any data withfetchone
,fetchmany
, orfetchall
. -
AllocNewVarsBuffer
can only be called once for a given write cursor instance. - Specifying a larger buffer size than is required has no effect on the result.
For an
example of the AllocNewVarsBuffer
method, see the example on multiple data passes in the topic on Write Mode (Python).