qdb_cell_type()

Return a cell's datatype

Synopsis:

#include <qdb/qdb.h>

int qdb_cell_type( qdb_result_t *res,
                   int row,
                   int col );

Arguments:

res
A pointer to a result structure to check.
row
The row number of the data cell.
col
The column number of the data cell.

Library:

qdb

Description:

This function returns the type of the specified cell, which you can use to cast the cell data to the proper C datatype. The datatypes that can be returned are defined in <qdb/qdb.h>. They are:

Return Type ANSI C Type Variable Length
QDB_UNSUPPORTED NULL No
QDB_INTEGER int64_t No
QDB_REAL double No
QDB_TEXT char * Yes
QDB_BLOB void * Yes
QDB_NULL NULL No

If the data can have variable length, then you should check its length by calling qdb_cell_length(). The text type QDB_TEXT (char *) is always null-terminated.

Returns:

>-1
The datatype of the specified cell.
-1
An error occurred (errno is set).

Classification:

QNX Neutrino

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

qdb_cell(), qdb_cell_length()