Share this page

# lrd_env_init

Allocates and initializes an LRDDBI handle. (Oracle 8.0 and later)

    LRDRET lrd_env_init( unsigned int muiDBType, void **mppvLRDDBIHandleEnv, unsigned long muliMode, int miDBErrorSeverity);

muiDBType | The target Database Types.
mppvLRDDBIHandleEnv | A pointer to a pointer to an LRDDBI handle.
muliMode | The operation mode.
miDBErrorSeverity | The Error Severity Levels of a failure in a database routine.

The lrd_env_init function allocates and initializes an LRDBI environment handle. If the pointed-to pointer is NULL, a new LRDDBI environment handle is allocated. If the value is non-NULL, if the pointed-to LRDDBI handle has the requested attribute, no new LRDDBI handle is allocated, and the function returns successfully. Otherwise, the LRDRET_E_EXISTING_HANDLE_ERROR is returned.

This function is only supported for Oracle 8.0 and higher.

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_env_init function initializes the environment for an LRDDBI handle.

    lrd_initialize_db(LRD_DBTYPE_ORACLE, 2, 0);
    lrd_env_init(LRD_DBTYPE_ORACLE, &OraEnv1, 0, 0);
    lrd_handle_alloc_ora(OraEnv1, SERVER, &OraSrv1, 0);
    lrd_handle_alloc_ora(OraEnv1, SVCCTX, &OraSvc1, 0);
    lrd_handle_alloc_ora(OraEnv1, SESSION, &OraSes1, 0);
    lrd_server_attach(OraSrv1, "rman", -1, 0, 0);
    lrd_attr_set_ora(OraSvc1, SERVER, OraSrv1, 0, 0);
    lrd_attr_set_ora(OraSes1, USERNAME, "orman2", -1, 0);
    lrd_attr_set_ora(OraSes1, PASSWORD, "tdtdtd", -1, 0);
    lrd_attr_set_ora(OraSvc1, SESSION, OraSes1, 0, 0);
    lrd_session_begin(OraSvc1, OraSes1, 1, 0, 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: