My Project
SQLStatement.h
1 #pragma once
2 
3 struct sqlite3_stmt;
4 struct sqlite3;
5 
6 namespace ParaInfoCenter
7 {
12  {
13  friend class DBEntity;
14  public:
15  CSQLStatement(void);
16  virtual ~CSQLStatement(void);
17  public:
18  //just the same as NextRow, but sounds more like executing a sql string
19  //but it does not tell whether the execute returns a row. it returns SQLITE_OK if success, and SQLITE_ERROR if failed;
20  //it will invalidate the recordset.
21  int Execute();
22 
23  /*
24  * This function is called to reset a compiled SQL
25  * statement obtained by a previous call to sqlite3_prepare() or
26  * sqlite3_prepare16() back to it's initial state, ready to be re-executed.
27  * Any SQL statement variables that had values bound to them using
28  * the DataBinging() API retain their values.
29  */
30  int Reset();
31 
32  int DataBinding(int index,double value);
33  int DataBinding(const char* name,double value);
34 
35  int DataBinding(int index,int value);
36  int DataBinding(const char* name,int value);
37 
38  int DataBinding(int index,int64 value);
39  int DataBinding(const char* name,int64 value);
40 
41  int DataBindingNull(int index);
42  int DataBindingNull(const char* name);
43 
44  int DataBinding(int index,const char*value);
45  int DataBinding(const char* name,const char*value);
46 
47  int DataBinding(int index,const WCHAR*value);
48  int DataBinding(const char* name,const WCHAR*value);
49 
50  int DataBinding(int index,const void*value,int size);
51  int DataBinding(const char* name,const void*value,int size);
52 
61  bool IsEOF(){return m_eof;};
62 
68  bool IsBOF(){return m_bof;};
69 
78  bool IsValid(){return m_isValid;};
79 
80  protected:
81  sqlite3_stmt *m_stmt;
82  sqlite3 *m_db;
83  bool m_isValid;
84  bool m_eof;
85  bool m_bof;
86 
87  };
88 
89 }
bool IsValid()
The recordset is invalid when:
Definition: SQLStatement.h:78
bool IsBOF()
The recordset is IsBOF()==true before the first NextRow() is called; in other words, no DataBinding should occur if it is BOF is true.
Definition: SQLStatement.h:68
Definition: PEtypes.h:503
a single database file.
Definition: ICDBManager.h:39
bool IsEOF()
The recordset is IsEOF()==true when.
Definition: SQLStatement.h:61
this represents SQL statement or stored procedure.
Definition: SQLStatement.h:11