mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-04 09:46:02 -04:00
Update Statement.cpp
This commit is contained in:
parent
81913790f2
commit
7738989228
@ -260,7 +260,14 @@ bool Statement::executeStep()
|
||||
const int ret = tryExecuteStep();
|
||||
if ((SQLITE_ROW != ret) && (SQLITE_DONE != ret)) // on row or no (more) row ready, else it's a problem
|
||||
{
|
||||
throw SQLite::Exception(mStmtPtr, ret);
|
||||
if (ret == sqlite3_errcode(mStmtPtr))
|
||||
{
|
||||
throw SQLite::Exception(mStmtPtr, ret);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw SQLite::Exception("Statement needs to be reseted", ret);
|
||||
}
|
||||
}
|
||||
|
||||
return mbHasRow; // true only if one row is accessible by getColumn(N)
|
||||
@ -276,10 +283,14 @@ int Statement::exec()
|
||||
{
|
||||
throw SQLite::Exception("exec() does not expect results. Use executeStep.");
|
||||
}
|
||||
else
|
||||
else if (ret == sqlite3_errcode(mStmtPtr))
|
||||
{
|
||||
throw SQLite::Exception(mStmtPtr, ret);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw SQLite::Exception("Statement needs to be reseted", ret);
|
||||
}
|
||||
}
|
||||
|
||||
// Return the number of rows modified by those SQL statements (INSERT, UPDATE or DELETE)
|
||||
|
Loading…
x
Reference in New Issue
Block a user