示例#1
0
Value SqlStatement::Fetch(Sql& cursor) const {
    ASSERT(text.GetCount());
    if(!Execute(cursor))
        return ErrorValue(SqlExc(cursor.GetSession()));
    if(!cursor.Fetch())
        return Null;
    return cursor[0];
}
示例#2
0
String ForceInsertRowid(const String& insert, Sql& cursor)
{
    if(!cursor.Execute(insert + " returning ROWID into ?%s"))
        throw SqlExc(cursor.GetSession());
    if(!cursor.Fetch())
        throw Exc(t_("FETCH internal error (ForceInsertRowid)"));
    ASSERT(!IsNull(cursor[0]));
    return cursor[0];
}
示例#3
0
int SqlError(
#ifdef PLATFORM_WIN32
	HWND parent,
#endif
	const char *text, const Sql& sql, bool retry) {
	return SqlError(
#ifdef PLATFORM_WIN32
		parent,
#endif
		text, sql.GetSession(), retry);
}
示例#4
0
void SqlStatement::Force(Sql& cursor) const {
    ASSERT(text.GetCount());
    if(!cursor.Execute(*this))
        throw SqlExc(cursor.GetSession());
}
示例#5
0
bool ShowError(Sql& sql, const char *msg) {
	return ShowError(sql.GetSession(), msg);
}
示例#6
0
bool DisplayError(const Sql& sql, const char *msg) {
	return DisplayError(sql.GetSession(), msg);
}
示例#7
0
bool OkCommit(Sql& sql, const char *emsg) {
	return OkCommit(sql.GetSession(), emsg);
}
示例#8
0
bool ErrorRollback(Sql& sql, const char *emsg) {
	return ErrorRollback(sql.GetSession(), emsg);
}
示例#9
0
文件: Sql.cpp 项目: ultimatepp/mirror
SqlExc::SqlExc(const Sql& sql) : Exc(sql_error) {
	SetSessionError(sql.GetSession());
}