MSSQL: MsSqlSequence

git-svn-id: svn://ultimatepp.org/upp/trunk@7772 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2014-10-13 07:07:56 +00:00
parent 24af0e755c
commit edfb15fcfd
2 changed files with 35 additions and 0 deletions

View file

@ -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];
}
};