3 #if wxUSE_DATABASE_SQLITE 36 wxSqliteStatementVector::iterator start =
m_Statements.begin();
37 wxSqliteStatementVector::iterator stop =
m_Statements.end();
42 sqlite3_finalize((sqlite3_stmt*)(*start));
70 int nReturn = sqlite3_bind_int(
m_Statements[nIndex], nPosition, nValue);
71 if (nReturn != SQLITE_OK)
88 int nReturn = sqlite3_bind_double(
m_Statements[nIndex], nPosition, dblValue);
89 if (nReturn != SQLITE_OK)
107 int nReturn = sqlite3_bind_text(
m_Statements[nIndex], nPosition, valueBuffer, -1, SQLITE_TRANSIENT);
108 if (nReturn != SQLITE_OK)
125 int nReturn = sqlite3_bind_null(
m_Statements[nIndex], nPosition);
126 if (nReturn != SQLITE_OK)
143 int nReturn = sqlite3_bind_blob(
m_Statements[nIndex], nPosition, (
const void*)pData, nDataLength, SQLITE_STATIC);
144 if (nReturn != SQLITE_OK)
157 if (dateValue.IsValid())
164 int nReturn = sqlite3_bind_text(
m_Statements[nIndex], nPosition, valueBuffer, -1, SQLITE_TRANSIENT);
165 if (nReturn != SQLITE_OK)
179 int nReturn = sqlite3_bind_null(
m_Statements[nIndex], nPosition);
180 if (nReturn != SQLITE_OK)
198 int nReturn = sqlite3_bind_int(
m_Statements[nIndex], nPosition, (bValue ? 1 : 0));
199 if (nReturn != SQLITE_OK)
213 wxSqliteStatementVector::iterator start =
m_Statements.begin();
214 wxSqliteStatementVector::iterator stop =
m_Statements.end();
215 while (start != stop)
217 nReturn += sqlite3_bind_parameter_count((sqlite3_stmt*)(*start));
227 wxSqliteStatementVector::iterator start =
m_Statements.begin();
228 wxSqliteStatementVector::iterator stop =
m_Statements.end();
229 while (start != stop)
231 int nReturn = sqlite3_step((sqlite3_stmt*)(*start));
233 if (nReturn != SQLITE_ROW)
234 sqlite3_reset((sqlite3_stmt*)(*start));
236 if ((nReturn != SQLITE_ROW) && (nReturn != SQLITE_DONE))
259 if (nReturn != SQLITE_ROW)
262 if ((nReturn != SQLITE_ROW) && (nReturn != SQLITE_DONE))
264 wxLogError(_(
"Error with RunQueryWithResults\n"));
293 int nParametersInThisStatement = sqlite3_bind_parameter_count(
m_Statements[i]);
294 if (*pPosition > nParametersInThisStatement)
296 *pPosition -= nParametersInThisStatement;
307 #endif//wxUSE_DATABASE_SQLITE
virtual void SetParamDouble(int nPosition, double dblValue)
Set the parameter at the 1-based position to a double value.
virtual ~wxSqlitePreparedStatement()
virtual void SetParamBlob(int nPosition, const void *pData, long nDataLength)
Set the parameter at the 1-based position to a Blob value.
void ThrowDatabaseException()
void SetErrorMessage(const wxString &strErrorMessage)
virtual void SetParamNull(int nPosition)
Set the parameter at the 1-based position to a NULL value.
virtual void SetParamDate(int nPosition, const wxDateTime &dateValue)
Set the parameter at the 1-based position to a wxDateTime value.
void LogResultSetForCleanup(wxDatabaseResultSet *pResultSet)
Add result set object pointer to the list for "garbage collection".
virtual int GetParameterCount()
void SetEncoding(wxFontEncoding encoding)
wxSqlitePreparedStatement(sqlite3 *pDatabase)
#define wxDATABASE_QUERY_RESULT_ERROR
virtual void SetParamString(int nPosition, const wxString &strValue)
Set the parameter at the 1-based position to a wxString value.
virtual void Close()
Close the result set (call wxDatabase::ClosePreparedStatement() instead on the statement)
wxSqliteStatementVector m_Statements
void CloseResultSets()
Close all result set objects that have been generated but not yet closed.
void SetErrorCode(int nErrorCode)
virtual void SetParamBool(int nPosition, bool bValue)
Set the parameter at the 1-based position to a boolean value.
static int TranslateErrorCode(int nCode)
void AddPreparedStatement(sqlite3_stmt *pStatement)
virtual wxString ConvertFromUnicodeStream(const char *inputBuffer)
const wxCSConv * GetEncoding()
wxDatabaseStatementHashSet m_Statements
virtual int RunQuery()
Run an insert, update, or delete query on the database.
virtual const wxCharBuffer ConvertToUnicodeStream(const wxString &inputString)
int FindStatementAndAdjustPositionIndex(int *pPosition)
virtual void SetParamInt(int nPosition, int nValue)
Set the parameter at the 1-based position to an int value.
virtual wxDatabaseResultSet * RunQueryWithResults()
Run an insert, update, or delete query on the database.