Share this page

# lrd_logon

Creates a simple database session.

    LRDRET lrd_logon( void *mpvLRDDBIHandleEnv, void **mppvLRDDBIHandleSvcCtx, char *mpcUserName, char *mpcPassword, char *mpcServerID, int miDBErrorSeverity );

mpvLRDDBIHandleEnv | A non-null pointer to an LRDDBI environment handle.
mppvLRDDBIHandleSvcCtx | A pointer to a pointer to an LRDDBI service context handle.
mpcUserName | A non-NULL pointer to a database user name.
mpcPassword | A non-NULL pointer to the password for the specified user name.
mpcServerId | A pointer to a string containing the database server ID. A NULL value designates the default host.
miDBErrorSeverity | The Error Severity Levels of a failure in a database routine.

The lrd_logon function creates a simple logon session, where the user name, password, and database server identification string are all null-terminated strings. This function is only supported for Oracle 8.0 and higher.

## Return Values

See LRD Return Values.

## Parameterization

The following arguments can be parameterized using standard parameterization: mpcUserName, mpcPassword, mpcServerId

## Example

In the following example, the lrd_logon function creates a simple logon session.

    lrd_init(&InitInfo, DBTypeVersion);
    lrd_initialize_db(LRD_DBTYPE_ORACLE, 1, 0);
    lrd_env_init(LRD_DBTYPE_ORACLE, &OraEnv1, 0, 0);
    lrd_logon(OraEnv1, &OraSvc1, "SCOTT", "TIGER", "hades", 0);
    lrd_ora8_handle_alloc(OraEnv1, STMT, &OraStm1, 0);
    lrd_ora8_handle_alloc(OraEnv1, STMT, &OraStm2, 0);
    lrd_ora8_stmt(OraStm1, "SELECT NVL(MAX(empno), 0) FROM emp", 1, 0, 0);
    lrd_ora8_exec(OraSvc1, OraStm1, 0, 0, &uliRowsProcessed, 0, 0, 0, 0, 0);
    lrd_ora8_bind_col(OraStm1, &OraDef1, 1, &NVL_MAX_EMPNO_0_D1, 0, 0);
    lrd_ora8_fetch(OraStm1, 1, 1, &uliFetchedRows, PrintRow1, 2, 0, 0);
    GRID8(1);
    lrd_ora8_stmt(OraStm1, "INSERT INTO emp(empno, ename, job, sal, deptno) "
            "VALUES (:empno, :ename, :job, :sal, :deptno)", 1, 0, 0);

    lrd_ora8_stmt(OraStm2, "SELECT dname FROM dept WHERE deptno = :1", 1, 0, 0);
    lrd_handle_free(&OraStm1, 0);
    lrd_handle_free(&OraStm2, 0);
    lrd_logoff(&OraSvc1, 0);
    lrd_handle_free(&OraEnv1, 0);
    return VUSER_OK;

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: