21 mStmtPtr(aDatabase.mpSQLite, mQuery),
26 mColumnCount = sqlite3_column_count(mStmtPtr);
40 int ret = sqlite3_reset(mStmtPtr);
47 int ret = sqlite3_bind_int(mStmtPtr, aIndex, aValue);
54 int ret = sqlite3_bind_int64(mStmtPtr, aIndex, aValue);
61 int ret = sqlite3_bind_double(mStmtPtr, aIndex, aValue);
68 int ret = sqlite3_bind_text(mStmtPtr, aIndex, aValue.c_str(), aValue.size(), SQLITE_TRANSIENT);
75 int ret = sqlite3_bind_text(mStmtPtr, aIndex, apValue, -1, SQLITE_TRANSIENT);
82 int ret = sqlite3_bind_blob(mStmtPtr, aIndex, apValue, aSize, SQLITE_TRANSIENT);
89 int ret = sqlite3_bind_null(mStmtPtr, aIndex);
97 int index = sqlite3_bind_parameter_index(mStmtPtr, apName);
98 int ret = sqlite3_bind_int(mStmtPtr, index, aValue);
105 int index = sqlite3_bind_parameter_index(mStmtPtr, apName);
106 int ret = sqlite3_bind_int64(mStmtPtr, index, aValue);
113 int index = sqlite3_bind_parameter_index(mStmtPtr, apName);
114 int ret = sqlite3_bind_double(mStmtPtr, index, aValue);
121 int index = sqlite3_bind_parameter_index(mStmtPtr, apName);
122 int ret = sqlite3_bind_text(mStmtPtr, index, aValue.c_str(), aValue.size(), SQLITE_TRANSIENT);
129 int index = sqlite3_bind_parameter_index(mStmtPtr, apName);
130 int ret = sqlite3_bind_text(mStmtPtr, index, apValue, -1, SQLITE_TRANSIENT);
137 int index = sqlite3_bind_parameter_index(mStmtPtr, apName);
138 int ret = sqlite3_bind_blob(mStmtPtr, index, apValue, aSize, SQLITE_TRANSIENT);
145 int index = sqlite3_bind_parameter_index(mStmtPtr, apName);
146 int ret = sqlite3_bind_null(mStmtPtr, index);
156 int ret = sqlite3_step(mStmtPtr);
157 if (SQLITE_ROW == ret)
161 else if (SQLITE_DONE == ret)
186 int ret = sqlite3_step(mStmtPtr);
187 if (SQLITE_DONE == ret)
192 else if (SQLITE_ROW == ret)
211 return sqlite3_changes(mStmtPtr);
222 else if ((aIndex < 0) || (aIndex >= mColumnCount))
228 return Column(mStmtPtr, aIndex);
238 else if ((aIndex < 0) || (aIndex >= mColumnCount))
243 return (SQLITE_NULL == sqlite3_column_type(mStmtPtr, aIndex));
247 void Statement::check(
const int aRet)
const
249 if (SQLITE_OK != aRet)
271 int ret = sqlite3_prepare_v2(apSQLite, aQuery.c_str(), aQuery.size(), &mpStmt, NULL);
272 if (SQLITE_OK != ret)
279 mpRefCount =
new unsigned int(1);
288 mpSQLite(aPtr.mpSQLite),
290 mpRefCount(aPtr.mpRefCount)
292 assert(NULL != mpRefCount);
293 assert(0 != *mpRefCount);
305 assert(NULL != mpRefCount);
306 assert(0 != *mpRefCount);
310 if (0 == *mpRefCount)
314 int ret = sqlite3_finalize(mpStmt);