PTLib Version 2.12.9

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
PODBC::Row Class Reference

Database Row Class This class functions as a simple wrapper of the Statement class to fetch/Save data to the Datasource. More...

`#include <podbc.h>`

Inheritance diagram for PODBC::Row:
[legend]
Collaboration diagram for PODBC::Row:
[legend]

## Public Member Functions
| Row (RecordSet &recordSet)
| Constructor. More...
PINDEX | Columns () const
| Columns. More...
PStringArray | ColumnNames () const
| Retrieve the Column Names. More...
PINDEX | ColumnByName (const PCaselessString &columnName) const
    ColumnByName returns the column number of the column name
If not found returns column value of 0; More...
Field & | Column (PINDEX column) const
| Retrieve Field Data given the specifed column. More...
Field & | Column (const PString &name) const
| Retreive Field Data given the Column Name. More...
Field & | operator[] (PINDEX column) const
| Retrieve Field Data given specified column. More...
Field & | operator[] (const PString &columnName) const
| Retrieve Field Data given the column Name. More...
PString | ColumnName (PINDEX column) const
| Column Name. More...
unsigned | ColumnType (PINDEX column) const
| ColumnTypes. More...
PINDEX | ColumnSize (PINDEX column) const
| Column Size. More...
unsigned | ColumnScale (PINDEX column) const
| Column Scale. More...
unsigned | ColumnPrecision (PINDEX column) const
    ColumnPrecision Get the Number of Decimal places
if Precision is set the precision is set to the lessor of the Two. More...
bool | IsColumnNullable (PINDEX column) const
| IsColumn Nullable. More...
bool | IsColumnUpdatable (PINDEX column) const
| IsColumn Updateable ie is not ReadOnly. More...
bool | IsColumnAutoIndex (PINDEX column) const
| IsColumnAutoIndex (ie don't give default Value) More...
void | SetNewRow ()
| Make this row a new one. More...
bool | MoveTo (RowIndex row)
| Move to Specified Row. More...
bool | Move (int offset)
| Move to row relative to current position. More...
bool | First ()
| First record. More...
bool | Next ()
| Next record. More...
bool | Previous ()
| Previous record. More...
bool | Last ()
| Last record. More...
bool | Delete (RowIndex rowIndex=0)
    Delete the Current Record from the
RecordSet More...
bool | Commit ()
| Post the Row back to the Database. More...
RowIndex | GetRowIndex () const
PINDEX | Rows ()
PINDEX | ColumnCount ()
bool | PostNew ()
bool | PostUpdate ()
bool | Post ()
bool | Navigate (RowIndex row)
Public Member Functions inherited from PObject
unsigned | GetTraceContextIdentifier () const
| Get PTRACE context identifier. More...
void | SetTraceContextIdentifier (unsigned id)
void | GetTraceContextIdentifier (PObject &obj)
void | GetTraceContextIdentifier (PObject *obj)
void | SetTraceContextIdentifier (const PObject &obj)
void | SetTraceContextIdentifier (const PObject *obj)
virtual | ~PObject ()
virtual PObject * | Clone () const
| Create a copy of the class on the heap. More...
template<class CLS >
CLS * | CloneAs () const
| As for Clone() but converts to specified type. More...
virtual PINDEX | HashFunction () const
| This function yields a hash value required by the `PDictionary` class. More...
virtual const char * | GetClass (unsigned ancestor=0) const
| Get the current dynamic type of the object instance. More...
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. More...
__inline const PObject * | PTraceObjectInstance () const
virtual Comparison | Compare (const PObject &obj) const
| Compare the two objects and return their relative rank. More...
virtual Comparison | CompareObjectMemoryDirect (const PObject &obj) const
| Determine the byte wise comparison of two objects. More...
bool | operator== (const PObject &obj) const
| Compare the two objects. More...
bool | operator!= (const PObject &obj) const
| Compare the two objects. More...
bool | operator< (const PObject &obj) const
| Compare the two objects. More...
bool | operator> (const PObject &obj) const
| Compare the two objects. More...
bool | operator<= (const PObject &obj) const
| Compare the two objects. More...
bool | operator>= (const PObject &obj) const
| Compare the two objects. More...
virtual void | PrintOn (ostream &strm) const
| Output the contents of the object to the stream. More...
virtual void | ReadFrom (istream &strm)
| Input the contents of the object from the stream. More...

## Protected Attributes
RecordSet & | m_recordSet
RowIndex | m_rowIndex
PArray< Field > | m_fields
| Current row number, starting at 1, 0 == new. More...
Protected Attributes inherited from PObject
unsigned | m_traceContextIdentifier

## 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. More...
static __inline const PObject * | PTraceObjectInstance (const char *)
static __inline const PObject * | PTraceObjectInstance (const PObject *obj)
static Comparison | InternalCompareObjectMemoryDirect (const PObject *obj1, const PObject *obj2, PINDEX size)
| Internal function caled from CompareObjectMemoryDirect() More...
Protected Member Functions inherited from PObject
| PObject ()
| Constructor for PObject, made protected so cannot ever create one on its own. More...
Friends inherited from PObject

## Detailed Description

Database Row Class This class functions as a simple wrapper of the Statement class to fetch/Save data to the Datasource.

Data is fetched on a need to basis and not cached except to create a new row.

## Constructor & Destructor Documentation

PODBC::Row::Row | ( | RecordSet & | recordSet | ) |

Constructor.

If rowIndex == 0, an empty record is used, otherwise that record number is fethed from back end.

## Member Function Documentation

Field& PODBC::Row::Column | ( | PINDEX | column | ) | const

Retrieve Field Data given the specifed column.

Note: Columns atart at 1 and not exceed Statement::GetColumnCount()

Referenced by PODBC::RecordSet::Column(), ColumnName(), ColumnPrecision(), ColumnScale(), ColumnSize(), ColumnType(), IsColumnAutoIndex(), IsColumnNullable(), IsColumnUpdatable(), and operator[]().

Field& PODBC::Row::Column | ( | const PString & | name | ) | const

Retreive Field Data given the Column Name.

PINDEX PODBC::Row::ColumnByName | ( | const PCaselessString & | columnName | ) | const

    ColumnByName returns the column number of the column name

If not found returns column value of 0;

PINDEX PODBC::Row::ColumnCount | ( |  | ) |
| inline

References Columns().

PString PODBC::Row::ColumnName | ( | PINDEX | column | ) | const
| inline

Column Name.

References Column(), and PODBC::Field::GetName().

Referenced by PODBC::RecordSet::ColumnName().

PStringArray PODBC::Row::ColumnNames | ( |  | ) | const

Retrieve the Column Names.

Referenced by PODBC::RecordSet::ColumnNames().

unsigned PODBC::Row::ColumnPrecision | ( | PINDEX | column | ) | const
| inline

    ColumnPrecision Get the Number of Decimal places

if Precision is set the precision is set to the lessor of the Two.

References Column(), and PODBC::Field::GetPrecision().

PINDEX PODBC::Row::Columns | ( |  | ) | const
| inline

Columns.

The Number of Columns in the RecordSet

References m_fields.

Referenced by ColumnCount(), and PODBC::RecordSet::Columns().

unsigned PODBC::Row::ColumnScale | ( | PINDEX | column | ) | const
| inline

Column Scale.

References Column(), and PODBC::Field::GetScale().

PINDEX PODBC::Row::ColumnSize | ( | PINDEX | column | ) | const
| inline

Column Size.

References Column(), and PVarType::GetSize().

unsigned PODBC::Row::ColumnType | ( | PINDEX | column | ) | const
| inline

ColumnTypes.

References Column(), and PODBC::Field::GetDataType().

bool PODBC::Row::Commit | ( |  | ) |

Post the Row back to the Database.

When Row::NewRow is true the data can be posted back to the Database; If Edit Invoked then releasea the RowHandler for Navigation.

Referenced by PODBC::RecordSet::Commit(), Post(), PODBC::RecordSet::Post(), PostNew(), and PostUpdate().

bool PODBC::Row::Delete | ( | RowIndex | rowIndex = `0` | ) |

    Delete the Current Record from the

RecordSet

bool PODBC::Row::First | ( |  | ) |

First record.

Referenced by PODBC::RecordSet::First().

RowIndex PODBC::Row::GetRowIndex | ( |  | ) | const
| inline

References m_rowIndex.

bool PODBC::Row::IsColumnAutoIndex | ( | PINDEX | column | ) | const
| inline

IsColumnAutoIndex (ie don't give default Value)

References Column(), and PODBC::Field::IsAutoIndex().

bool PODBC::Row::IsColumnNullable | ( | PINDEX | column | ) | const
| inline

IsColumn Nullable.

Accepts NULL value

References Column(), and PODBC::Field::IsNullable().

bool PODBC::Row::IsColumnUpdatable | ( | PINDEX | column | ) | const
| inline

IsColumn Updateable ie is not ReadOnly.

References Column(), and PODBC::Field::IsUpdatable().

bool PODBC::Row::Last | ( |  | ) |

Last record.

Referenced by PODBC::RecordSet::Last().

bool PODBC::Row::Move | ( | int | offset | ) |

Move to row relative to current position.

Referenced by PODBC::RecordSet::Move().

bool PODBC::Row::MoveTo | ( | RowIndex | row | ) |

Move to Specified Row.

Referenced by PODBC::RecordSet::MoveTo(), and Navigate().

bool PODBC::Row::Navigate | ( | RowIndex | row | ) |
| inline

References MoveTo().

bool PODBC::Row::Next | ( |  | ) |

Next record.

Referenced by PODBC::RecordSet::Next().

Field& PODBC::Row::operator[] | ( | PINDEX | column | ) | const
| inline

Retrieve Field Data given specified column.

References Column().

Field& PODBC::Row::operator[] | ( | const PString & | columnName | ) | const
| inline

Retrieve Field Data given the column Name.

References Column().

bool PODBC::Row::Post | ( |  | ) |
| inline

References Commit().

bool PODBC::Row::PostNew | ( |  | ) |
| inline

References Commit().

bool PODBC::Row::PostUpdate | ( |  | ) |
| inline

References Commit().

bool PODBC::Row::Previous | ( |  | ) |

Previous record.

Referenced by PODBC::RecordSet::Previous().

PINDEX PODBC::Row::Rows | ( |  | ) |

void PODBC::Row::SetNewRow | ( |  | ) |

Make this row a new one.

## Member Data Documentation

PArray<Field> PODBC::Row::m_fields
| protected

Current row number, starting at 1, 0 == new.

Referenced by Columns().

RecordSet& PODBC::Row::m_recordSet
| protected

RowIndex PODBC::Row::m_rowIndex
| protected

Referenced by GetRowIndex().

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

- podbc.h