Public Member Functions

db_query_Resultset Class Reference

a database resultset. More...

#include <structs.db.query.h>

Inheritance diagram for db_query_Resultset:
GrtObject db_query_EditableResultset

List of all members.

Public Member Functions

grt::ListRef
< db_query_ResultsetColumn
columns () const
 Getter for attribute columns (read-only).
grt::IntegerRef currentRow () const
 Getter for attribute currentRow (read-only).
grt::IntegerRef pinned () const
 Getter for attribute pinned.
virtual void pinned (const grt::IntegerRef &value)
 Setter for attribute pinned.
grt::IntegerRef rowCount () const
 Getter for attribute rowCount (read-only).
grt::StringRef sql () const
 Getter for attribute sql (read-only).
virtual grt::DoubleRef floatFieldValue (long column)
 returns the float contents of the field at the given column index and current row
virtual grt::DoubleRef floatFieldValueByName (const std::string &column)
 returns the float contents of the field at the given column name and current row
virtual grt::IntegerRef goToFirstRow ()
 sets the current row index to the 1st
virtual grt::IntegerRef goToLastRow ()
 sets the current row index to the last
virtual grt::IntegerRef goToRow (long row)
 sets the current row pointer to the given index
virtual grt::IntegerRef intFieldValue (long column)
 returns the integer contents of the field at the given column index and current row
virtual grt::IntegerRef intFieldValueByName (const std::string &column)
 returns the integer contents of the field at the given column name and current row
virtual grt::IntegerRef nextRow ()
 moves the current row pointer to the next one
virtual grt::IntegerRef previousRow ()
 moves the current row pointer to the previous one
virtual grt::IntegerRef refresh ()
 refreshes the resultset, re-executing the originator query
virtual grt::IntegerRef saveFieldValueToFile (long column, const std::string &file)
 saves the contents of the field at given column and current row to a file
virtual grt::StringRef stringFieldValue (long column)
 returns the contents of the field at the given column index and current row as a string.
virtual grt::StringRef stringFieldValueByName (const std::string &column)
 returns the contents of the field at the given column name and current row as a string.

Detailed Description

a database resultset.

This object does not allow changes to the resultset, if you need to edit the resultset, see db_query_EditableResultset


Member Function Documentation

grt::ListRef<db_query_ResultsetColumn> columns (  )  const

Getter for attribute columns (read-only).

the columns of the resultset

In Python:
value = obj.columns
grt::IntegerRef currentRow (  )  const

Getter for attribute currentRow (read-only).

In Python:
value = obj.currentRow
virtual grt::DoubleRef floatFieldValue ( long  column  )  [virtual]

returns the float contents of the field at the given column index and current row

Parameters:
column 
Returns:
value stored in cell (can be null)
virtual grt::DoubleRef floatFieldValueByName ( const std::string &  column  )  [virtual]

returns the float contents of the field at the given column name and current row

Parameters:
column 
Returns:
value stored in cell (can be null)
virtual grt::IntegerRef goToFirstRow (  )  [virtual]

sets the current row index to the 1st

Returns:
(boolean) 1 on success or 0 if the row number is out of bounds
virtual grt::IntegerRef goToLastRow (  )  [virtual]

sets the current row index to the last

Returns:
(boolean) 1 on success or 0 if the row number is out of bounds
virtual grt::IntegerRef goToRow ( long  row  )  [virtual]

sets the current row pointer to the given index

Parameters:
row 
Returns:
(boolean) 1 on success or 0 if the row number is out of bounds
virtual grt::IntegerRef intFieldValue ( long  column  )  [virtual]

returns the integer contents of the field at the given column index and current row

Parameters:
column 
Returns:
value stored in cell (can be null)
virtual grt::IntegerRef intFieldValueByName ( const std::string &  column  )  [virtual]

returns the integer contents of the field at the given column name and current row

Parameters:
column 
Returns:
value stored in cell (can be null)
virtual grt::IntegerRef nextRow (  )  [virtual]

moves the current row pointer to the next one

Returns:
(boolean) 1 on success or 0 if the new row number is out of bounds
grt::IntegerRef pinned (  )  const

Getter for attribute pinned.

whether a docked resultset will be kept when a new query is executed

In Python:
value = obj.pinned
virtual void pinned ( const grt::IntegerRef &  value  )  [virtual]

Setter for attribute pinned.

whether a docked resultset will be kept when a new query is executed

In Python:
obj.pinned = value
virtual grt::IntegerRef previousRow (  )  [virtual]

moves the current row pointer to the previous one

Returns:
(boolean) 1 on success or 0 if the new row number is out of bounds
virtual grt::IntegerRef refresh (  )  [virtual]

refreshes the resultset, re-executing the originator query

Returns:
grt::IntegerRef rowCount (  )  const

Getter for attribute rowCount (read-only).

In Python:
value = obj.rowCount
virtual grt::IntegerRef saveFieldValueToFile ( long  column,
const std::string &  file 
) [virtual]

saves the contents of the field at given column and current row to a file

Parameters:
column 
file 
Returns:
(boolean)
grt::StringRef sql (  )  const

Getter for attribute sql (read-only).

the SQL statement that generated this resultset

In Python:
value = obj.sql
virtual grt::StringRef stringFieldValue ( long  column  )  [virtual]

returns the contents of the field at the given column index and current row as a string.

If the column type is not string, it will be converted

Parameters:
column 
Returns:
value stored in cell (can be null)
virtual grt::StringRef stringFieldValueByName ( const std::string &  column  )  [virtual]

returns the contents of the field at the given column name and current row as a string.

If the column type is not string, it will be converted

Parameters:
column 
Returns:
value stored in cell (can be null)