mysql.stmt.bind_out

Package mysql :: Package stmt :: Module bind_out |
[hide private]
[frames] | no frames]

# Module bind_out

MySQL Statement Output Binding.

This module contains all the Statement output binding objects. When you create a new Statement object that selecs data, you need to call mysql.stmt.Statement.bind_output with instances of these objects to indicate which Python variable to set with the output value.

All output binding objects take at least two parameters, the first is the object in which to set the value. The second is the name (as a string) of the parameter to set.

Some output bindings, such as string objects, take a third argument which is the maximum expected size of the value. If the data is truncated, then the call to `fetch` raises mysql.exceptions.Data_Truncated.

The "streaming" output bindings (blob and text) take an optional fourth argument `use_stream`. If this is set to True, then the value in your object will show up as a stream object with a `read` method. Otherwise the value will be set as a string. See Base_Out_Stream for more detail.

All values may be returned as None for NULL values.

As a reference, use the following objects for their corresponding MySQL types:

- TINYINT: Out_Tiny_Int
- TINYINT UNSIGNED: Out_U_Tiny_Int
- SMALLINT: Out_Small_Int
- SMALLINT UNSIGNED: Out_U_Small_Int
- MEDIUMINT: Out_Medium_Int (currently an alias to Out_Int)
- MEDIUMINT UNSIGNED: Out_U_Medium_Int (currently an alias to Out_U_Int)
- INT: Out_Int
- INT UNSIGNED: Out_U_Int
- BIGINT: Out_Big_Int
- BIGINT UNSIGNED: Out_U_Big_Int
- BIT: Out_Bit
- BOOL: Out_Bool
- FLOAT: Out_Float
- FLOAT UNSIGNED: Out_U_Float
- DOUBLE: Out_Double
- DOUBLE UNSIGNED: Out_U_Double
- DECIMAL: Out_Decimal
- DECIMAL UNSIGNED: Out_U_Decimal (currently an alias to Out_Decimal)
- DATE: Out_Date
- DATETIME: Out_Date_Time
- TIMESTAMP: Out_Timestamp
- TIME: Out_Time
- YEAR: Out_Year
- CHAR: Out_Char
- VARCHAR: Out_Varchar
- BINARY: Out_Binary (currently an alias to Out_Char)
- VARBINARY: Out_Varbinary (currently an alias to Out_Varchar)
- ENUM: Out_Enum (currently an alias to Out_Varchar)
- SET: Out_Set
- TINYBLOB: Out_Tiny_Blob
- MEDIUMBLOB: Out_Medium_Blob
- BLOB: Out_Blob
- LONGBLOB: Out_Long_Blob
- TINYTEXT: Out_Tiny_Text (currently an alias to Out_Tiny_Blob)
- MEDIUMTEXT: Out_Medium_Text (currently an alias to Out_Medium_Blob)
- TEXT: Out_Text (currently an alias to Out_Blob)
- LONGTEXT: Out_Long_Text (currently an alias to Out_Long_Blob)

The following output binding types are not supported:

- GEOMETRY
- INT24
- NEWDATE

Classes | [hide private]
`` | Base_Out_Stream Base class for streaming output.
`` | Base_Out_String Base string-type output binding.
`` | Out_Big_Int BIGINT output binding.
`` | Out_Binary CHAR output binding.
`` | Out_Bit BIT output binding.
`` | Out_Blob BLOB output binding.
`` | Out_Bool BOOL output binding.
`` | Out_Char CHAR output binding.
`` | Out_Date DATE output binding.
`` | Out_Date_Time DATETIME output binding.
`` | Out_Decimal DECIMAL output binding.
`` | Out_Double DOUBLE output binding.
`` | Out_Enum VARCHAR output binding.
`` | Out_Float FLOAT output binding.
`` | Out_Int INT output binding.
`` | Out_Long_Blob LONGBLOB output binding.
`` | Out_Long_Text LONGBLOB output binding.
`` | Out_Medium_Blob MEDIUMBLOB output binding.
`` | Out_Medium_Int INT output binding.
`` | Out_Medium_Text MEDIUMBLOB output binding.
`` | Out_New_Decimal NEW DECIMAL output binding.
`` | Out_Null Null output binding.
`` | Out_Set SET output binding.
`` | Out_Small_Int SMALLINT output binding.
`` | Out_Text BLOB output binding.
`` | Out_Time TIME output binding.
`` | Out_Timestamp TIMESTAMP output binding.
`` | Out_Tiny_Blob TINYBLOB output binding.
`` | Out_Tiny_Int TINYINT output binding.
`` | Out_Tiny_Text TINYBLOB output binding.
`` | Out_U_Big_Int UNSIGNED BIGINT output binding.
`` | Out_U_Decimal DECIMAL output binding.
`` | Out_U_Double DOUBLE output binding.
`` | Out_U_Float FLOAT output binding.
`` | Out_U_Int UNSIGNED INT output binding.
`` | Out_U_Medium_Int UNSIGNED INT output binding.
`` | Out_U_New_Decimal NEW DECIMAL output binding.
`` | Out_U_Small_Int UNSIGNED SMALLINT output binding.
`` | Out_U_Tiny_Int UNSIGNED TINYINT output binding.
`` | Out_Varbinary VARCHAR output binding.
`` | Out_Varchar VARCHAR output binding.
`` | Out_Year YEAR output binding.
`` | Output_Bind Base output binding class.
`` | Output_Stream Output stream.

Variables | [hide private]
`` | __version__ = `'$Revision: 1.7 $'`

Variables Details | [hide private]

    ### __version__ Value:
        '$Revision: 1.7 $'