PTLib  Version 2.10.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PODBC::Table Class Reference

PODBC::Table

This is the main Class to access Data returned by a Select Query. More...

#include <podbc.h>

Inheritance diagram for PODBC::Table:
PObject

Public Member Functions

Constructor/Deconstructor
 Table (PODBC *odbc, PString Query)
 
Constructor

Using the HDBC and TableName/Select SQL Query creates a virtual Table in the OBDC driver.

 ~Table ()
 Deconstructor.
Data Storage
Row NewRow ()
 Add New Row.
PBoolean DeleteRow (PINDEX row=0)
 Delete Row 0 indicates Current Row.
PBoolean Post ()
 Post Update back to Database.
Utilities
PINDEX Rows ()
 Rows.
PINDEX Columns ()
 Columns.
PStringArray ColumnNames ()
 ColumnNames.
RowRecordHandler ()
 Obtain the Record Handler.
Rowoperator[] (PINDEX row)
 Row return the fetched row in the Cached RecordSet.
Fieldoperator() (PINDEX row, PINDEX col)
 
Returns the Field data at a predetermined position in the Resultant

RecordSet.

FieldColumn (PINDEX col)
 
Returns the indicated Column Holder for the RecordSet,

This can be used for iterative Row calls.

FieldColumn (PString Name)
 Returns the indicated Column Holder Name for the RecordSet,.
- Public Member Functions inherited from PObject
virtual ~PObject ()
virtual PObjectClone () const
 Create a copy of the class on the heap.
virtual PINDEX HashFunction () const
 This function yields a hash value required by the PDictionary class.
virtual const char * GetClass (unsigned ancestor=0) const
 Get the current dynamic type of the object instance.
PBoolean IsClass (const char *cls) const
virtual PBoolean InternalIsDescendant (const char *clsName) const
 Determine if the dynamic type of the current instance is a descendent of the specified class.
virtual Comparison Compare (const PObject &obj) const
 Compare the two objects and return their relative rank.
virtual Comparison CompareObjectMemoryDirect (const PObject &obj) const
 Determine the byte wise comparison of two objects.
bool operator== (const PObject &obj) const
 Compare the two objects.
bool operator!= (const PObject &obj) const
 Compare the two objects.
bool operator< (const PObject &obj) const
 Compare the two objects.
bool operator> (const PObject &obj) const
 Compare the two objects.
bool operator<= (const PObject &obj) const
 Compare the two objects.
bool operator>= (const PObject &obj) const
 Compare the two objects.
virtual void PrintOn (ostream &strm) const
 Output the contents of the object to the stream.
virtual void ReadFrom (istream &strm)
 Input the contents of the object from the stream.

Protected Attributes

PODBCStmt stmt
PString tableName
 ODBC Fetched Statement Info.
RowRowHandler
 Name of the Fetched Table (if used in Constructor)

Additional Inherited Members

- Public Types inherited from PObject
enum  Comparison { LessThan = -1, EqualTo = 0, GreaterThan = 1 }
 Result of the comparison operation performed by the Compare() function. More...
- Static Public Member Functions inherited from PObject
static const char * Class ()
 Get the name of the class as a C string.
static Comparison InternalCompareObjectMemoryDirect (const PObject *obj1, const PObject *obj2, PINDEX size)
 Internal function caled from CompareObjectMemoryDirect()
- Protected Member Functions inherited from PObject
 PObject ()
 Constructor for PObject, made protected so cannot ever create one on its own.
- Friends inherited from PObject

Detailed Description

PODBC::Table

This is the main Class to access Data returned by a Select Query.

The Table does not actually create the RecordSet but acts as a wrapper to the driver to access the cached data in the Driver.

Constructor & Destructor Documentation

PODBC::Table::Table ( PODBC odbc,
PString  Query 
)

Constructor

Using the HDBC and TableName/Select SQL Query creates a virtual Table in the OBDC driver.

PODBC::Table::~Table ( )

Deconstructor.

Member Function Documentation

Field& PODBC::Table::Column ( PINDEX  col)

Returns the indicated Column Holder for the RecordSet,

This can be used for iterative Row calls.

Field& PODBC::Table::Column ( PString  Name)

Returns the indicated Column Holder Name for the RecordSet,.

PStringArray PODBC::Table::ColumnNames ( )

ColumnNames.

Return the list of column Names of the Resultant RecordSet

PINDEX PODBC::Table::Columns ( )

Columns.

Returns the Number of Columns in the Resultant RecordSet

PBoolean PODBC::Table::DeleteRow ( PINDEX  row = 0)

Delete Row 0 indicates Current Row.

Row PODBC::Table::NewRow ( )

Add New Row.

Field& PODBC::Table::operator() ( PINDEX  row,
PINDEX  col 
)

Returns the Field data at a predetermined position in the Resultant

RecordSet.

It Fetches the Row than isolates the Column from the fetched data.

Row& PODBC::Table::operator[] ( PINDEX  row)

Row return the fetched row in the Cached RecordSet.

An Array of PODBC::Field

PBoolean PODBC::Table::Post ( )

Post Update back to Database.

Row& PODBC::Table::RecordHandler ( )

Obtain the Record Handler.

This can be used as a Template to obtain Record Information. A call to tablename[i] will update the recordHandler with the Values contained in i Record.

PINDEX PODBC::Table::Rows ( )

Rows.

Returns the Number of Rows in the Resultant RecordSet

Member Data Documentation

Row* PODBC::Table::RowHandler
protected

Name of the Fetched Table (if used in Constructor)

PODBCStmt PODBC::Table::stmt
protected
PString PODBC::Table::tableName
protected

ODBC Fetched Statement Info.


The documentation for this class was generated from the following file: