Share this page

# lrd_db_option

Sets a database option.

    LRDRET lrd_db_option( void *mpvTargetObject, unsigned long muliOption, void *mpvOptionValue, int miDBErrorSeverity);

mpvTargetObject | A pointer to an object such as an LRD_CONTEXT, LRD_CURSOR, or LRD_CONNECTION structure.
muliOption | One of the Database Options
mpvOptionValue | A Database option value. One of:LRD_OPTION_VAL_LETTER_YES (`Y')LRD_OPTION_VAL_LETTER_NO (`N')LRD_OPTION_VAL_LETTER_PARTIAL (`P')LRD_OPTION_VAL_LETTER_DEFAULT (`D')
miDBErrorSeverity | The Error Severity Levels of a failure in a database routine.

The lrd_db_option function sets an option for a database cursor, context, or connection.

For more details refer to the Function Header File lrd.h in the include directory.

## Return Values

See LRD Return Values.

## Parameterization

You cannot use standard parameterization for any arguments in this function.

## Example

In the following example, the lrd_db_option function sets two ODBC options. The first option activates the ODBC's SQL_TXN_READ_COMMITTED option and the second option deactivates the SQL_AUTOCOMMIT option.

    lrd_init(&InitInfo, DBTypeVersion);

    lrd_open_context(&Ctx1, LRD_DBTYPE_ODBC, 0, 0, 0);

    lrd_alloc_connection(&Con1, LRD_DBTYPE_ODBC, Ctx1, 0 /*Unused*/, 0);

    lrd_db_option

        (Con1, OT_ODBC_TXN_READ_COMMITTED,

        LRD_OPTION_VAL_LETTER_YES,

        LRD_DB_ERROR_SEVERITY_ERROR);

    lrd_db_option

        (Con1, OT_ODBC_AUTOCOMMIT,

        LRD_OPTION_VAL_LETTER_NO,

        LRD_DB_ERROR_SEVERITY_ERROR);

    lrd_open_connection(&Con1, LRD_TYPE_ODBC, "", "", "flight32_quadbase", "", Ctx1, 0, 0);

    lrd_open_cursor(&Csr1, Con1, 0);

Tips to improve your search results... VuGen Function Reference Version 26.1 Function Reference 26.1 All View Local Help Center View Online Help Center Version: