1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-05 05:37:39 +02:00

- implemented insertId() in MS SQL driver

This commit is contained in:
David Grudl
2008-11-09 20:03:08 +00:00
parent 9f8b19f1fb
commit 2f690b63f9

View File

@@ -133,7 +133,12 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver
*/ */
public function insertId($sequence) public function insertId($sequence)
{ {
throw new NotSupportedException('MS SQL does not support autoincrementing.'); $res = mssql_query('SELECT @@IDENTITY', $this->connection);
if (is_resource($res)) {
$row = mssql_fetch_row($res);
return $row[0];
}
return FALSE;
} }