Package | system.db.schema.mssql |
---|---|
Inheritance | class CMssqlPdoAdapter » PDO |
Source Code | framework/db/schema/mssql/CMssqlPdoAdapter.php |
Method | Description | Defined By |
---|---|---|
__construct() | PDO | |
__sleep() | PDO | |
__wakeup() | PDO | |
beginTransaction() | Begin a transaction | CMssqlPdoAdapter |
commit() | Commit a transaction | CMssqlPdoAdapter |
errorCode() | PDO | |
errorInfo() | PDO | |
exec() | PDO | |
getAttribute() | PDO | |
getAvailableDrivers() | PDO | |
inTransaction() | PDO | |
lastInsertId() | Get the last inserted id value | CMssqlPdoAdapter |
prepare() | PDO | |
query() | PDO | |
quote() | PDO | |
rollBack() | Rollback a transaction | CMssqlPdoAdapter |
setAttribute() | PDO |
public boolean beginTransaction()
| ||
{return} | boolean |
public function beginTransaction ()
{
$this->exec('BEGIN TRANSACTION');
return true;
}
Begin a transaction
Is is necessary to override pdo's method, as mssql pdo drivers
does not support transaction
public boolean commit()
| ||
{return} | boolean |
public function commit ()
{
$this->exec('COMMIT TRANSACTION');
return true;
}
Commit a transaction
Is is necessary to override pdo's method, as mssql pdo drivers
does not support transaction
public integer lastInsertId(string|null $sequence=NULL)
| ||
$sequence | string|null | sequence name. Defaults to null |
{return} | integer | last inserted id |
public function lastInsertId ($sequence=NULL)
{
return $this->query('SELECT CAST(COALESCE(SCOPE_IDENTITY(), @@IDENTITY) AS bigint)')->fetchColumn();
}
Get the last inserted id value MSSQL doesn't support sequence, so, argument is ignored
public boolean rollBack()
| ||
{return} | boolean |
public function rollBack ()
{
$this->exec('ROLLBACK TRANSACTION');
return true;
}
Rollback a transaction
Is is necessary to override pdo's method, ac mssql pdo drivers
does not support transaction
Signup or Login in order to comment.