FixIO Documentation

Back to summary

use "io/sql";

ResultSet class

Provides access to SQL query results.

Subclasses: SQLiteResultSet

Initialization

static function create(): ResultSet
Creates a new instance of ResultSet class (for implementations only).
function close()
Closes the access to SQL query results.

Traversing

function next(): Boolean
Advances to the next row (initially the cursor is before the first row). Returns true if a row is available.

Metadata

function get_column_count(): Integer
Returns the number of columns.
function get_column_name(idx: Integer): String
Returns the name of the column at given index.
function get_column_index(name: String): Integer
Returns the column index for given name. Throws an error on a non-existing name. In case there are duplicate names the first index is returned.
function get_column_type(name_or_idx: String or Integer): Integer
Returns the type of the given column.

Data access functions

function is_null(name_or_idx: String or Integer): Boolean
Returns true when there is a NULL value in given column.
function get_int(name_or_idx: String or Integer): Integer
function get_long(name_or_idx: String or Integer): Long
function get_float(name_or_idx: String or Integer): Float
function get_double(name_or_idx: String or Integer): Double
function get_string(name_or_idx: String or Integer): String
function get_binary(name_or_idx: String or Integer): Byte[]
Returns the value in given column. Throws an error if NULL is encountered.
function get_optional_int(name_or_idx: String or Integer, def_value: Integer): Integer
function get_optional_long(name_or_idx: String or Integer): Long
function get_optional_float(name_or_idx: String or Integer, def_value: Float): Float
function get_optional_double(name_or_idx: String or Integer): Double
function get_optional_string(name_or_idx: String or Integer): String
function get_optional_binary(name_or_idx: String or Integer): Byte[]
A variant of the value retrieval functions that return null when the value is not available (or the default value for primitive types).