Share this page

# lrd_open_cursor

Opens a cursor.

    LRDRET lrd_open_cursor( LRD_CURSOR **mpptCursor, LRD_CONNECTION *mptConnection, int miDBErrorSeverity );

mpptCursor | A pointer to a pointer to an LRD_CURSOR structure.
mptConnection | A pointer to an LRD_CONNECTION structure.
miDBErrorSeverity | The Error Severity Levels of a failure in a database routine.

The lrd_open_cursor function opens a cursor by setting up an LRD_CURSOR structure. You can use a single cursor to execute successive SQL statements. The structure is valid until you free it with lrd_close_cursor.

Note that VuGen's "cursor" refers to a logical resource that is associated with all types of SQL statements. This should not be confused with the embedded SQL CURSOR (for example, DECLARE CURSOR, OPEN CURSOR, etc.).

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 cursor is opened after a connection is made with an Oracle server. An SQL statement is executed using the cursor.

    lrd_open_connection(&Con1, LRD_DBTYPE_ORACLE, "fred", "lion", "hammer", "", 0, 0, 0);
    lrd_open_cursor(&Csr1, Con1, 0);
    . . .
    lrd_stmt(Csr1, "select ename\nfrom emp\nwhere job='CLERK'\n\n", -1, 1, 1, 0);
    lrd_bind_col(Csr1, 1, &D11_ENAME, 0);
    lrd_exec(Csr1, 0, 0, 0, 0);
    lrd_fetch(Csr1, -4, 15, 0, PrintRow16, 0);
    lrd_commit(Con1, 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: