mysql.stmt.bind_in

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

# Module bind_in

MySQL Statement Input Binding.

This module contains all the Statement input binding objects. When you create a new Statement object with parameters, you need to call mysql.stmt.Statement.bind_input with instances of these objects to indicate which Python variable to read the value from.

All input binding objects take at least two parameters, the first is the object in which to look for a parameter. The second is the name (as a string) of the parameter to read.

Some input bindings, such as string objects, take a third argument which is the maximum expected size of the value.

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

All values may be set to None in which case the value will be set to NULL in the database. However, when you are using a stream, do not write any data, and the value will be set to NULL. If you want an empty string when using a stream, call write with an empty string.

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

- TINYINT: In_Tiny_Int
- TINYINT UNSIGNED: In_U_Tiny_Int
- SMALLINT: In_Small_Int
- SMALLINT UNSIGNED: In_U_Small_Int
- MEDIUMINT: In_Medium_Int
- MEDIUMINT UNSIGNED: In_U_Medium_Int
- INT: In_Int
- INT UNSIGNED: In_U_Int
- BIGINT: In_Big_Int
- BIGINT UNSIGNED: In_U_Big_Int
- BIT: In_Bit
- BOOL: In_Bool
- FLOAT: In_Float
- FLOAT UNSIGNED: In_U_Float
- DOUBLE: In_Double
- DOUBLE UNSIGNED: In_U_Double
- DECIMAL: In_Decimal (Warning: broken in server 5.0.18 and earlier.)
- DECIMAL UNSIGNED: In_U_Decimal (Warning: broken in server 5.0.18 and earlier.)
- DATE: In_Date
- DATETIME: In_Date_Time
- TIMESTAMP: In_Timestamp
- TIME: In_Time
- YEAR: In_Year
- CHAR: In_Char
- VARCHAR: In_Varchar
- BINARY: In_Binary (currently an alias to In_Char)
- VARBINARY: In_Varbinary (currently an alias to In_Varchar)
- ENUM: In_Enum
- SET: In_Set
- TINYBLOB: In_Tiny_Blob
- MEDIUMBLOB: In_Medium_Blob
- BLOB: In_Blob
- LONGBLOB: In_Long_Blob
- TINYTEXT: In_Tiny_Text (currently an alias to In_Tiny_Blob)
- MEDIUMTEXT: In_Medium_Text (currently an alias to In_Medium_Blob)
- TEXT: In_Text (currently an alias to In_Blob)
- LONGTEXT: In_Long_Text (currently an alias to In_Long_Blob)

The following input binding types are not supported:

- GEOMETRY
- INT24
- NEWDATE

Classes | [hide private]
`` | Base_Decimal Signed Decimal input binding.
`` | Base_In_Stream Base class for streaming input.
`` | Base_In_String Base class input binding that is a character array from a string.
`` | In_Big_Int BIGINT input binding.
`` | In_Binary CHAR input binding.
`` | In_Bit BIT input binding.
`` | In_Blob BLOB input binding.
`` | In_Bool BOOL input binding.
`` | In_Char CHAR input binding.
`` | In_Date DATE input binding.
`` | In_Date_Time DATETIME input binding.
`` | In_Decimal Signed Decimal input binding.
`` | In_Double DOUBLE input binding.
`` | In_Enum ENUM input binding.
`` | In_Float FLOAT input binding.
`` | In_Int INT input binding.
`` | In_Long_Blob LONGBLOB input binding.
`` | In_Long_Text LONGBLOB input binding.
`` | In_Medium_Blob MEDIUMBLOB input binding.
`` | In_Medium_Int MEDIUMINT input binding.
`` | In_Medium_Text MEDIUMBLOB input binding.
`` | In_New_Decimal Signed "new" decimal input binding.
`` | In_Null Null input binding.
`` | In_Set SET input binding.
`` | In_Small_Int SMALLINT input binding.
`` | In_Text BLOB input binding.
`` | In_Time TIME input binding.
`` | In_Timestamp TIMESTAMP input binding.
`` | In_Tiny_Blob TINYBLOB input binding.
`` | In_Tiny_Int TINYINT input binding.
`` | In_Tiny_Text TINYBLOB input binding.
`` | In_U_Big_Int UNSIGNED BIG INT input binding.
`` | In_U_Decimal Unsigned Decimal input binding.
`` | In_U_Double UNSIGNED DOUBLE input binding.
`` | In_U_Float UNSIGNED FLOAT input binding.
`` | In_U_Int UNSIGNED INT input binding.
`` | In_U_Medium_Int UNSIGNED MEDIUMINT input binding.
`` | In_U_New_Decimal Unsigned "new" decimal input binding.
`` | In_U_Small_Int UNSIGNED SMALLINT input binding.
`` | In_U_Tiny_Int UNSIGNED TINYINT input binding.
`` | In_Varbinary VARCHAR input binding.
`` | In_Varchar VARCHAR input binding.
`` | In_Year YEAR input binding.
`` | Input_Bind Base input binding class.
`` | Input_Stream Input Stream.

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

Variables Details | [hide private]

    ### __version__ Value:
        '$Revision: 1.5 $'