Public Member Functions

wxPostgreSQLresult Class Reference

#include <wxPostgreSQL.h>

List of all members.

Public Member Functions

 wxPostgreSQLresult ()
 wxPostgreSQLresult (wxResult *res)
 ~wxPostgreSQLresult ()
wxExecStatusType Status ()
void Clear ()
char * StatusMessage (wxExecStatusType status)
char * ErrorMessage ()
char * ErrorFieldMessage (int fieldcode)
int GetNumberRows ()
int GetNumberFields ()
int IsBinary ()
char * FieldName (int field_num)
int FieldNumber (const char *field_name)
wxOid FieldTable (int field_num)
int FieldTableColumn (int field_num)
int FieldFormat (int field_num)
wxOid FieldType (int field_num)
int FieldSize (int field_num)
int FieldModifier (int field_num)
char * CommandStatus ()
char * OIDStatus ()
wxOid OIDValue ()
char * CommandNumberRows ()
char * GetValue (int tup_num, int field_num)
int GetLength (int tup_num, int field_num)
int IsNull (int tup_num, int field_num)
int NumberParams ()
wxOid ParamType (int param_num)
void Print (FILE *fout, const wxPrintOpt *ps)
void DisplayRows (FILE *fp, int fillAlign, const char *fieldSep, int printHeader, int quiet)
void PrintRows (FILE *fout, int printAttName, int terseOutput, int width)

Detailed Description

Contain result that return from wxPostgreSQL Query or Command


Constructor & Destructor Documentation

wxPostgreSQLresult::wxPostgreSQLresult (  )

Default constructor

wxPostgreSQLresult::wxPostgreSQLresult ( wxResult *  res )

Constructor from an result

wxPostgreSQLresult::~wxPostgreSQLresult (  )

Default destructor


Member Function Documentation

void wxPostgreSQLresult::Clear (  )

Frees the storage associated with a wxPostgreSQLresult. Every command result should be freed via Clear() when it is no longer needed.

char* wxPostgreSQLresult::CommandNumberRows (  )

Returns the number of rows affected by the SQL command.

char* wxPostgreSQLresult::CommandStatus (  )

Returns the command status tag from the SQL command that generated the PGresult.

void wxPostgreSQLresult::DisplayRows ( FILE *  fp,
int  fillAlign,
const char *  fieldSep,
int  printHeader,
int  quiet 
)

really old printing routines

char* wxPostgreSQLresult::ErrorFieldMessage ( int  fieldcode )

Returns an individual field of an error report.

char* wxPostgreSQLresult::ErrorMessage (  )

Returns the error message associated with the command, or an empty string if there was no error.

int wxPostgreSQLresult::FieldFormat ( int  field_num )

Returns the format code indicating the format of the given column. Column numbers start at 0.

int wxPostgreSQLresult::FieldModifier ( int  field_num )

Returns the type modifier of the column associated with the given column number. Column numbers start at 0.

char* wxPostgreSQLresult::FieldName ( int  field_num )

Returns the column name associated with the given column number. Column numbers start at 0. The caller should not free the result directly. It will be freed when the associated wxPostgreSQLresult handle is passed to Clear.

int wxPostgreSQLresult::FieldNumber ( const char *  field_name )

Returns the column number associated with the given column name.

int wxPostgreSQLresult::FieldSize ( int  field_num )

Returns the size in bytes of the column associated with the given column number. Column numbers start at 0.

wxOid wxPostgreSQLresult::FieldTable ( int  field_num )

Returns the wxOID of the table from which the given column was fetched. Column numbers start at 0.

int wxPostgreSQLresult::FieldTableColumn ( int  field_num )

Returns the column number (within its table) of the column making up the specified query result column. Query-result column numbers start at 0, but table columns have nonzero numbers.

wxOid wxPostgreSQLresult::FieldType ( int  field_num )

Returns the data type associated with the given column number. The integer returned is the internal OID number of the type. Column numbers start at 0.

int wxPostgreSQLresult::GetLength ( int  tup_num,
int  field_num 
)

Returns the actual length of a field value in bytes. Row and column numbers start at 0.

int wxPostgreSQLresult::GetNumberFields (  )

Returns the number of columns (fields) in each row of the query result.

int wxPostgreSQLresult::GetNumberRows (  )

Returns the number of rows (tuples) in the query result. Because it returns an integer result, large result sets might overflow the return value on 32-bit operating systems.

char* wxPostgreSQLresult::GetValue ( int  tup_num,
int  field_num 
)

Returns a single field value of one row of a PGresult. Row and column numbers start at 0. The caller should not free the result directly. It will be freed when the associated wxPostgreSQLresult handle is passed to Clear.

int wxPostgreSQLresult::IsBinary (  )

Returns 1 if the wxPostgreSQLresult contains binary data and 0 if it contains text data.

int wxPostgreSQLresult::IsNull ( int  tup_num,
int  field_num 
)

Tests a field for a null value. Row and column numbers start at 0.

int wxPostgreSQLresult::NumberParams (  )

Returns the number of parameters of a prepared statement.

char* wxPostgreSQLresult::OIDStatus (  )

Returns a string with the OID of the inserted row, if the SQL command was an INSERT that inserted exactly one row, or a EXECUTE of a prepared statement consisting of a suitable INSERT. (The string will be 0 if the INSERT did not insert exactly one row, or if the target table does not have OIDs.) If the command was not an INSERT, returns an empty string.

wxOid wxPostgreSQLresult::OIDValue (  )

Returns the OID of the inserted row, if the SQL command was an INSERT that inserted exactly one row into a table that has OIDs, or a EXECUTE of a prepared query containing a suitable INSERT statement. Otherwise, this function returns InvalidOid. This function will also return InvalidOid if the table affected by the INSERT statement does not contain OIDs.

wxOid wxPostgreSQLresult::ParamType ( int  param_num )

Returns the data type of the indicated statement parameter. Parameter numbers start at 0.

void wxPostgreSQLresult::Print ( FILE *  fout,
const wxPrintOpt *  ps 
)

Prints out all the rows and, optionally, the column names to the specified output stream

void wxPostgreSQLresult::PrintRows ( FILE *  fout,
int  printAttName,
int  terseOutput,
int  width 
)

Prints out all the rows to the specified output stream with custom format

wxExecStatusType wxPostgreSQLresult::Status (  )

Returns the result status of the command. Value are: PGRES_EMPTY_QUERY = 0, PGRES_COMMAND_OK, PGRES_TUPLES_OK, PGRES_COPY_OUT, PGRES_COPY_IN, PGRES_BAD_RESPONSE, PGRES_NONFATAL_ERROR, PGRES_FATAL_ERROR

char* wxPostgreSQLresult::StatusMessage ( wxExecStatusType  status )

Converts the enumerated type returned by ResultStatus into a string constant describing the status code. The caller should not free the result.


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



free counters

[ top ]