DBI connection handle returned by DBIConnect.
class DBIHandle
close() | Close the database handle. |
getLastInsertedId() | Get the ID of the last record inserted. |
sqlExpand() | Expands a sql parameter string and its parameters into a complete string. |
startTransaction() | Start a transaction |
DBI connection handle returned by DBIConnect.
You will not instantiate this class directly, instead, you must use DBIConnect.
Close the database handle.
DBIHandle.close( )
Get the ID of the last record inserted.
DBIHandle.getLastInsertedId( )
Returns: | Integer |
This is database dependent but so widely used, it is included in the DBI module. Some databases such as MySQL only support getting the last inserted ID globally in the database server while others like PostgreSQL allow you to get the last inserted ID of any table. Thus, it is suggested that you always supply the sequence id as which to query. DBI drivers such as MySQL are programmed to ignore the extra information and return simply the last ID inserted into the database.
Expands a sql parameter string and its parameters into a complete string.
DBIHandle.sqlExpand( sql, ... )
sql | The string to be expanded. |
... | The data that must be expanded. |
Returns: | String |
This is what is usually done by engines not supporting binding and positional parameters; :1, :2, :N markers are expanded into properly translated and escaped values taken from the coresponding parameter.
Start a transaction
DBIHandle.startTransaction( )
Returns: | an instance of DBITransaction This method returns a new transaction. |