3 #if wxUSE_DATABASE_ODBC 9 m_pInterface = pInterface;
10 m_sqlEnvHandle = sqlEnvHandle;
12 m_bOneTimeStatement =
false;
18 m_pInterface = pInterface;
19 m_sqlEnvHandle = sqlEnvHandle;
21 m_bOneTimeStatement =
false;
22 m_Statements.push_back(sqlStatementHandle);
28 m_pInterface = pInterface;
29 m_sqlEnvHandle = sqlEnvHandle;
31 m_bOneTimeStatement =
false;
32 m_Statements = statements;
46 wxOdbcStatementVector::iterator start =
m_Statements.begin();
47 wxOdbcStatementVector::iterator stop =
m_Statements.end();
53 if ( nRet != SQL_SUCCESS && nRet != SQL_SUCCESS_WITH_INFO )
68 ArrayOfOdbcParameters::iterator start =
m_Parameters.begin();
69 ArrayOfOdbcParameters::iterator stop =
m_Parameters.end();
151 wxOdbcStatementVector::iterator start =
m_Statements.begin();
152 wxOdbcStatementVector::iterator stop =
m_Statements.end();
153 while (start != stop)
157 if ( nRet != SQL_SUCCESS && nRet != SQL_SUCCESS_WITH_INFO )
176 wxOdbcStatementVector::iterator start =
m_Statements.begin();
177 wxOdbcStatementVector::iterator stop =
m_Statements.end();
178 while (start != stop)
183 if (nRet != SQL_SUCCESS && nRet != SQL_SUCCESS_WITH_INFO)
192 if ( nRet != SQL_SUCCESS && nRet != SQL_SUCCESS_WITH_INFO && nRet != SQL_NO_DATA && nRet != SQL_NEED_DATA)
199 if ( nRet == SQL_NEED_DATA)
203 while (nRet == SQL_NEED_DATA)
213 if (nRet != SQL_SUCCESS)
226 if (nRet != SQL_SUCCESS && nRet != SQL_NO_DATA_FOUND && nRet != SQL_SUCCESS_WITH_INFO)
254 SQLSMALLINT ncol = 0;
264 if ( nRet != SQL_SUCCESS && nRet != SQL_SUCCESS_WITH_INFO )
272 if ( nRet != SQL_SUCCESS && nRet != SQL_SUCCESS_WITH_INFO )
280 if ( nRet != SQL_SUCCESS && nRet != SQL_SUCCESS_WITH_INFO )
305 if ((nIndex > -1) && (pParameter != NULL))
308 SQLSMALLINT dataType;
310 SQLSMALLINT dataDigits;
311 SQLSMALLINT isNullable;
313 &dataDigits, &isNullable);
314 if ( ret != SQL_SUCCESS )
325 if ( nRet != SQL_SUCCESS && nRet != SQL_SUCCESS_WITH_INFO )
348 if ( nRet != SQL_SUCCESS && nRet != SQL_SUCCESS_WITH_INFO )
355 int nParametersInThisStatement = (int)num;
356 if (*pPosition > nParametersInThisStatement)
358 *pPosition -= nParametersInThisStatement;
387 wxLogDebug(_(
"OdbcPreparedStatement::InterpretErrorCodes()\n"));
391 SQLINTEGER iNativeCode;
412 #endif//wxUSE_DATABASE_ODBC SQLFreeStmtType GetSQLFreeStmt()
virtual void SetParamBool(int nPosition, bool bValue)
Set the parameter at the 1-based position to a boolean value.
virtual int RunQuery()
Run an insert, update, or delete query on the database.
SQLRowCountType GetSQLRowCount()
SQLNumResultColsType GetSQLNumResultCols()
SQLLEN * GetParameterLengthPtr()
wxOdbcStatementVector m_Statements
virtual wxDatabaseResultSet * RunQueryWithResults()
Run an insert, update, or delete query on the database.
wxOdbcInterface * m_pInterface
SQLSMALLINT GetValueType()
SQLBindParameterType GetSQLBindParameter()
void ThrowDatabaseException()
virtual void SetParamBlob(int nPosition, const void *pData, long nDataLength)
Set the parameter at the 1-based position to a Blob value.
int FindStatementAndAdjustPositionIndex(int *pPosition)
virtual ~wxOdbcPreparedStatement()
SQLDescribeParamType GetSQLDescribeParam()
void SetErrorMessage(const wxString &strErrorMessage)
SQLUINTEGER GetColumnSize()
virtual void Close()
Close the result set (call wxDatabase::ClosePreparedStatement() instead on the statement)
void AddPreparedStatement(SQLHSTMT pStatement)
void LogResultSetForCleanup(wxDatabaseResultSet *pResultSet)
Add result set object pointer to the list for "garbage collection".
#define wxDATABASE_QUERY_RESULT_ERROR
SQLExecuteType GetSQLExecute()
virtual void SetParamInt(int nPosition, int nValue)
Set the parameter at the 1-based position to an int value.
virtual void SetParamString(int nPosition, const wxString &strValue)
Set the parameter at the 1-based position to a wxString value.
SQLPutDataType GetSQLPutData()
SQLSMALLINT GetDecimalDigits()
void CloseResultSets()
Close all result set objects that have been generated but not yet closed.
SQLNumParamsType GetSQLNumParams()
void SetErrorCode(int nErrorCode)
wxOdbcPreparedStatement(wxOdbcInterface *pInterface, SQLHENV sqlEnvHandle, SQLHDBC sqlHDBC)
SQLGetDiagRecType GetSQLGetDiagRec()
virtual wxString ConvertFromUnicodeStream(const char *inputBuffer)
SQLParamDataType GetSQLParamData()
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.
SQLSMALLINT GetParameterType()
void SetParam(int nPosition, wxOdbcParameter *pParameter)
virtual void SetParamDouble(int nPosition, double dblValue)
Set the parameter at the 1-based position to a double value.
void InterpretErrorCodes(long nCode, SQLHSTMT stmth_ptr=NULL)
ArrayOfOdbcParameters m_Parameters
virtual int GetParameterCount()
SQLFreeHandleType GetSQLFreeHandle()