Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

pqxx::Cursor Class Reference

SQL cursor class. More...

#include <cursor.h>

List of all members.

Public Methods

 Cursor (TransactionItf &T, const char Query[], PGSTD::string BaseName="cur", Result_size_type Count=NEXT())
 Constructor. Creates a cursor.

Result_size_type SetCount (Result_size_type)
 Set new stride, ie. the number of rows to fetch at a time.

Result Fetch (Result_size_type Count)
 Fetch Count rows of data.

void Move (Result_size_type Count)
 Move forward by Count rows (negative for backwards) through the data set.

Cursor & operator>> (Result &)
 Fetch rows.

 operator bool () const
 May there be more rows coming?

bool operator! () const
 Are we done?

Cursor & operator+= (Result_size_type N)
 Move N rows forward.

Cursor & operator-= (Result_size_type N)
 Move N rows backward.


Static Public Methods

Result_size_type ALL ()
 Constant: "next fetch/move should span as many rows as possible.".

Result_size_type NEXT ()
 Constant: "next fetch/move should cover just the next row.".

Result_size_type PRIOR ()
 Constant: "next fetch/move should go back one row.".

Result_size_type BACKWARD_ALL ()


Detailed Description

SQL cursor class.

Cursor behaves as an output stream generating Result objects. They may be used to fetch rows individually or in blocks, in which case each Result coming out of the stream may contain more than one Tuple.

Postgres does not currently support modification of data through a cursor.


Constructor & Destructor Documentation

pqxx::Cursor::Cursor TransactionItf   T,
const char    Query[],
PGSTD::string    BaseName = "cur",
Result_size_type    Count = NEXT()
 

Constructor. Creates a cursor.

Parameters:
T  is the transaction that this cursor lives in.
Query  defines a data set that the cursor should traverse.
BaseName  optional name for the cursor, must begin with a letter and contain letters and digits only.
Count  the stride of the cursor, ie. the number of rows fetched at a time. This defaults to 1.


Member Function Documentation

Result_size_type pqxx::Cursor::ALL   [static]
 

Constant: "next fetch/move should span as many rows as possible.".

If the number of rows ahead exceeds the largest number your machine can comfortably conceive, this may not actually be all remaining rows in the result set.

Result_size_type pqxx::Cursor::BACKWARD_ALL   [static]
 

If the number of rows behind the cursor exceeds the largest number your machine can comfortably conceive, this may not bring you all the way back to the beginning.

pqxx::Result pqxx::Cursor::Fetch Result_size_type    Count
 

Fetch Count rows of data.

The number of rows fetched will not exceed Count, but it may be lower.

void pqxx::Cursor::Move Result_size_type    Count
 

Move forward by Count rows (negative for backwards) through the data set.

Result_size_type pqxx::Cursor::NEXT   [static]
 

Constant: "next fetch/move should cover just the next row.".

pqxx::Cursor::operator bool   const
 

May there be more rows coming?

bool pqxx::Cursor::operator!   const
 

Are we done?

Cursor& pqxx::Cursor::operator+= Result_size_type    N
 

Move N rows forward.

Cursor& pqxx::Cursor::operator-= Result_size_type    N
 

Move N rows backward.

pqxx::Cursor & pqxx::Cursor::operator>> Result  
 

Fetch rows.

The number of rows retrieved will be no larger than (but may be lower than) the rowcount set using the SetCount() function, or passed to the constructor as the Count argument. The default is 1. This operator lends itself to"while(Cur >> R) { ... }"-style use; the Cursor's conversion to bool tests whether it has arrived at the end of its data set.

Result_size_type pqxx::Cursor::PRIOR   [static]
 

Constant: "next fetch/move should go back one row.".

pqxx::Result_size_type pqxx::Cursor::SetCount Result_size_type   
 

Set new stride, ie. the number of rows to fetch at a time.


The documentation for this class was generated from the following files:
Generated on Wed Oct 23 15:57:06 2002 for libpqxx by doxygen1.2.18