Set an option for a database connection
Synopsis:
#include <qdb/qdb.h>
int qdb_setoption( qdb_hdt_t *hdl,
int option,
int value );
Arguments:
- hdl
- A pointer to the database handle to set the option for.
- option
- The option to set. It can be one of:
- QDB_OPTION_LAST_INSERT_ROWID — automatically put the last inserted ROWID into any result you fetch. If this option isn't set, that data isn't included
in the result structure, and calling qdb_last_insert_rowid() will query the database connection for this information instead.
By default, this option is on.
- QDB_OPTION_ROW_CHANGES — put the number of rows affected by a statement into any result you fetch. If this option isn't set, that data isn't included
in the result structure, and calling qdb_rowchanges() will query the database connection for this information instead.
By default, this option is on.
- QDB_OPTION_COLUMN_NAMES — populate the column names into the qdb_result_t that is returned from qdb_getresult(). If this option isn't set, that data isn't provided, and calling qdb_column_index() won't work.
By default, this option is on.
- QDB_OPTION_COLUMN_DECLTYPES — populate the declared column types in the qdb_result_t that is returned from qdb_getresult(). If this option isn't set, that data isn't provided, and calling qdb_column_decltype() won't work.
By default, this option is off.
- value
- The value to set the option to: either 0 (off) or 1 (on).
Description:
This function sets options for the database connection hdl. By default, all of
these options are on except for QDB_OPTION_COLUMN_DECLTYPES, which is off.
Returns:
- ≥0
- Success. The previous value for option is returned.
- -1
- The option specified isn't supported (errno is set).
Classification:
QNX Neutrino
Safety: |
|
Interrupt handler |
No |
Signal handler |
No |
Thread |
Yes |