Using a result

A result is a block of memory containing a description of each cell and the cell's data. There are functions that give you easy access to this data:

Function Name Use
qdb_columns() Returns the number of columns
qdb_rows() Returns the number of rows. An empty result will return 0.
qdb_cell_type() Returns the type of data in a cell (QDB_INTEGER, QDB_REAL, QDB_TEXT, QDB_BLOB, QDB_NULL).
qdb_column_name() Returns the column name from the database schema
qdb_cell() Returns the cell data as a void pointer that can be cast to the correct type
qdb_column_index() Gets the column number that matches the passed in name
qdb_cell_length() Returns the length of a cell's data
qdb_printmsg() Prints the contents of a result, which can be useful for debugging