mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-09-02 16:22:40 -06:00
MSSQL: MsSqlSequence
git-svn-id: svn://ultimatepp.org/upp/trunk@7772 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
24af0e755c
commit
edfb15fcfd
2 changed files with 35 additions and 0 deletions
|
|
@ -20,4 +20,18 @@ void IdentityInsert(const SqlInsert& ins)
|
|||
IdentityInsert(SQL, ins);
|
||||
}
|
||||
|
||||
Value MsSqlSequence::Get()
|
||||
{
|
||||
#ifndef NOAPPSQL
|
||||
Sql sql(session ? *session : SQL.GetSession());
|
||||
#else
|
||||
ASSERT(session);
|
||||
Sql sql(*session);
|
||||
#endif
|
||||
if(!sql.Execute("select next value for " + ~seq) || !sql.Fetch())
|
||||
return ErrorValue();
|
||||
return sql[0];
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue