Return a cell's datatype
#include <qdb/qdb.h>
int qdb_cell_type( qdb_result_t *res,
int row,
int col );
qdb
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>:
| 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.
QNX Neutrino
| Safety: | |
|---|---|
| Interrupt handler | No |
| Signal handler | No |
| Thread | Yes |