Variable Objects

Note

The DB API definition does not define this object.

Variable.buffer_size

This read-only attribute returns the size of the buffer allocated for each element.

Variable.getvalue([pos=0])

Return the value at the given position in the variable.

Variable.inconverter

This read-write attribute specifies the method used to convert data from Python to the database. The method signature is converter(value) and the expected return value is the value to bind to the database. If this attribute is None, the value is bound directly without any conversion.

Variable.input

This read-write attribute specifies whether the variable is used as an input variable and should normally be left as True.

Variable.num_elements

This read-only attribute returns the number of elements allocated.

Variable.outconverter

This read-write attribute specifies the method used to convert data from from the database to Python. The method signature is converter(value) and the expected return value is the value to return to Python. If this attribute is None, the value is returned directly without any conversion.

Variable.output

This read-write attribute specifies whether the variable is used as an output variable. It should normally be left as False except when calling stored procedures with output variables.

Variable.scale

This read-only attribute returns the scale of the variable.

Variable.setvalue(pos, value)

Set the value at the given position in the variable.

Variable.size

This read-only attribute returns the size of the variable.

Variable.type

This read-only attribute returns the type of the variable.