Share this page

# lrd_bind_cursor

Binds a cursor to a placeholder.

    LRDRET lrd_bind_cursor( LRD_CURSOR *mptCursor, char *mpszPlaceholder, unsigned long muliOption, LRD_CURSOR **mpptBoundCursor, int miDBErrorSeverity );

mptCursor | A pointer to an LRD_CURSOR structure.
mpszPlaceholder | A pointer to a string containing the placeholder name.
muliOption | One of the LRD Binding Options.
mpptBoundCursor | A pointer to a pointer to the newly created LRD_CURSOR structure.
miDBErrorSeverity | The Error Severity Levels of a failure in a database routine.

The lrd_bind_cursor function binds a cursor to a placeholder in the SQL statement text. This function is used with statements containing PL/SQL commands

that open bound cursors or call a stored procedure to do so. The bound cursor can later be accessed using other cursor functions such as lrd_fetch or lrd_close_cursor.

Note: VuGen does not automatically close cursors that were opened by lrd_bind_cursor. To close open cursors, use the lrd_close_cursor function.

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

## Return Values

See LRD Return Values.

## Parameterization

The following argument can be parameterized using standard parameterization: mpszPlaceholder

## Example

In the following example, the lrd_bind_cursor function binds a cursor, Csr1, to the placeholder Cursor1 to create a new bound cursor, Csr2. The contents of the new cursor are retrieved using lrd_fetch.

    lrd_stmt(Csr1, "BEGIN open :Cursor1 for select empno from emp where empno "
                        "<> 1000; END;", -1, 0, 1, 0);
    lrd_bind_cursor(Csr1, "Cursor1", 0, &Csr2, 0);
    lrd_exec(Csr1, 0, 0, 0, 0, 0);
    lrd_bind_col(Csr2, 1, &EMPNO_D2, 0, 0);
    lrd_fetch(Csr2, -14, 1, 0, PrintRow2, 0);

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