IDatabaseQuery Class
(CDP2SQL::IDatabaseQuery)Abstract interface base for queries. More...
Header: | #include <IDatabaseQuery> |
Public Functions
virtual | ~IDatabaseQuery() |
virtual void | Close() = 0 |
virtual void | ExecuteQuery(const std::string &sqlString) = 0 |
virtual void | ExecuteQuery(IDatabaseStatement *st) = 0 |
virtual std::string | FieldName(int field) const = 0 |
virtual std::string | FieldType(int field) const = 0 |
virtual const unsigned char * | FieldValueBlob(int field, int &len) const = 0 |
virtual bool | FieldValueBool(int field) const = 0 |
virtual double | FieldValueDouble(int field) const = 0 |
virtual int64_t | FieldValueInt64(int field) const = 0 |
virtual int | FieldValueInt(int field) const = 0 |
virtual std::string | FieldValueStr(int field) const = 0 |
virtual bool | IsEof() = 0 |
virtual bool | IsFieldValueNull(int field) const = 0 |
virtual bool | NextRow() = 0 |
virtual unsigned int | NumFields() const = 0 |
Detailed Description
Abstract interface base for queries.
Concrete implementations are created (and destroyed) by IDatabaseConnection.
Member Function Documentation
[virtual]
IDatabaseQuery::~IDatabaseQuery()
Should have virtual destructor for all abstract classes. Must close query if open.
[pure virtual]
void IDatabaseQuery::Close()
Finalizes the query. Should do any major cleanup on the query.
[pure virtual]
void IDatabaseQuery::ExecuteQuery(const std::string &sqlString)
Executes an SQL query string.
[pure virtual]
void IDatabaseQuery::ExecuteQuery(IDatabaseStatement *st)
Executes an SQL query using the given IDatabaseStatement.
The IDatabaseStatement must be ready for use (unused or Reset, and any placeholder binded)
[pure virtual]
std::string IDatabaseQuery::FieldName(int field) const
Name of field in column field.
[pure virtual]
std::string IDatabaseQuery::FieldType(int field) const
Type of field in column field.
[pure virtual]
const unsigned char *IDatabaseQuery::FieldValueBlob(int field, int &len) const
Gets blob value and length. Pointer is valid until calling NextRow(), Close() or ExecuteQuery().
[pure virtual]
bool IDatabaseQuery::FieldValueBool(int field) const
Gets value in column field as boolean.
Returns false
if field is NULL or 0. Otherwise true
.
[pure virtual]
double IDatabaseQuery::FieldValueDouble(int field) const
Gets value in column field as floating point.
[pure virtual]
int64_t IDatabaseQuery::FieldValueInt64(int field) const
Gets value in column field as int64_t.
[pure virtual]
int IDatabaseQuery::FieldValueInt(int field) const
Gets value in column field as integer.
[pure virtual]
std::string IDatabaseQuery::FieldValueStr(int field) const
Gets value in column field as string.
[pure virtual]
bool IDatabaseQuery::IsEof()
Returns true
if we have reached the End-Of-File for the results.
[pure virtual]
bool IDatabaseQuery::IsFieldValueNull(int field) const
Returns true
if the field value is a SQL NULL.
[pure virtual]
bool IDatabaseQuery::NextRow()
Goes to the next row. Returns false
if there is no next row in the result.
[pure virtual]
unsigned int IDatabaseQuery::NumFields() const
Returns how many fields (columns) does the result have.
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.