Share this page

# lrd_bind_col

Binds a host variable to a column.

    LRDRET lrd_bind_col( LRD_CURSOR *mptCursor, int muiColNum, LRD_VAR_DESC *mptVarDesc, long mliOption, int miDBErrorSeverity);

mptCursor | A pointer to an LRD_CURSOR structure.
muiColNum | The column number in the result set.
mptVarDesc | A pointer to the descriptor of a variable to bind.
mliOption | A database dependent option (NULL).
miDBErrorSeverity | The Error Severity Levels of a failure in a database routine.

A host variable is automatically generated by VuGen. It has the following structure:

<column name>_D<data index>

For example, &ENAME_D3 represents the third set of data whose column name is "ENAME".

The lrd_bind_col function binds a host variable to an output column. VuGen generates an lrd_bind_col statement for all columns in the result set.

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, a SELECT statement retrieves all of the database records that contain a value of 1000 or greater in their SAL column. lrd_exec executes the statement and lrd_bind_col binds all of the columns to host variables.

     /* Set up and execute the SQL statement.*/

    lrd_stmt(Csr1, "select ename from emp where (sal>=1000)\n", -1, 1/*Deferred*/, 1/*Default Ora Ver*/, 0);

    lrd_bind_col(Csr1, 1, &ENAME_D21, 0, 0);

    lrd_exec(Csr1, 0, 0, 0, 0, 1);

    lrd_fetch(Csr1, -3, 1, 0, PrintRow24, 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: