Version: 1.0.0
tds_preparedstatement.h
Go to the documentation of this file.
1 #ifndef _WX_DATABASE_TDS_PREPARED_STATEMENT_H_
2 #define _WX_DATABASE_TDS_PREPARED_STATEMENT_H_
3 
4 #include "wx/database/wxprec.h"
5 
7 
9 {
10 public:
11  // ctor
12  wxTdsPreparedStatement(TDSSOCKET* pDatabase, TDSDYNAMIC* pStatement, const wxString& strQuery);
13 
14  // dtor
15  virtual ~wxTdsPreparedStatement();
16 
17  virtual void Close();
18 
19  // get field
20  virtual void SetParamInt(int nPosition, int nValue);
21  virtual void SetParamDouble(int nPosition, double dblValue);
22  virtual void SetParamString(int nPosition, const wxString& strValue);
23  virtual void SetParamNull(int nPosition);
24  virtual void SetParamBlob(int nPosition, const void* pData, long nDataLength);
25  virtual void SetParamDate(int nPosition, const wxDateTime& dateValue);
26  virtual void SetParamBool(int nPosition, bool bValue);
27  virtual int GetParameterCount();
28 
29  virtual int RunQuery();
31 
32 private:
34  void AllocateParameter(int nPosition);
35  int FindStatementAndAdjustPositionIndex(int* pPosition);
37 
38  TDSSOCKET* m_pDatabase;
39  TDSDYNAMIC* m_pStatement;
41 };
42 
43 #endif//_WX_DATABASE_TDS_PREPARED_STATEMENT_H_
44 
virtual void SetParamDate(int nPosition, const wxDateTime &dateValue)
Set the parameter at the 1-based position to a wxDateTime value.
virtual void Close()
Close the result set (call wxDatabase::ClosePreparedStatement() instead on the statement)
virtual void SetParamBlob(int nPosition, const void *pData, long nDataLength)
Set the parameter at the 1-based position to a Blob value.
virtual void SetParamString(int nPosition, const wxString &strValue)
Set the parameter at the 1-based position to a wxString value.
virtual int GetParameterCount()
int FindStatementAndAdjustPositionIndex(int *pPosition)
wxTdsPreparedStatement(TDSSOCKET *pDatabase, TDSDYNAMIC *pStatement, const wxString &strQuery)
void SetErrorInformationFromDatabaseLayer()
virtual wxDatabaseResultSet * RunQueryWithResults()
Run an insert, update, or delete query on the database.
virtual void SetParamBool(int nPosition, bool bValue)
Set the parameter at the 1-based position to a boolean value.
virtual ~wxTdsPreparedStatement()
virtual void SetParamNull(int nPosition)
Set the parameter at the 1-based position to a NULL value.
void AllocateParameter(int nPosition)
virtual void SetParamInt(int nPosition, int nValue)
Set the parameter at the 1-based position to an int value.
virtual int RunQuery()
Run an insert, update, or delete query on the database.
virtual void SetParamDouble(int nPosition, double dblValue)
Set the parameter at the 1-based position to a double value.