Share this page

# lrd_cancel

Cancels the results of a query.

    LRDRET lrd_cancel( LRD_CONNECTION *mptConnection, LRD_CURSOR *mptCursor, long mliOption, int miDBErrorSeverity );

mptConnection | A pointer to an LRD_CONNECTION structure.
mptCursor | A pointer to an LRD_CURSOR structure.
mliOption | One of the Cancel Options.
miDBErrorSeverity | The Error Severity Levels of a failure in a database routine.

The lrd_cancel function cancels the previous statement or information submitted to the database server. In Oracle, lrd_cancel informs the server to cancel the query and free any resources associated with the cursor. This is useful if you require only the first row(s) of a multi-row query. You call lrd_cancel after lrd_fetch to inform the server that you will not perform additional fetches.

You can use lrd_cancel to reset a single cursor or all the cursors in a connection. Note that one of the first two parameters must be NULL. If you are canceling the contents of a cursor, the mptConnection parameter must be NULL. If you are canceling the contents of all the cursors in a connection, the mptCursor parameter must be NULL.

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, lrd_cancel resets the cursor, Csr2.

    lrd_stmt(Csr2, "select first_name, last_name, salary,", "date_of_birth,dept from employee where (emp_id<9000)AND(emp_id>1000) ",-1, 1 /*Deferred*/, 1 /*Dflt Ora Ver*/, 0);

    lrd_exec(Csr2, 0, 0, 0, 0, 0);

    lrd_bind_col(Csr2, 1, &FIRST_NAME_D14, 0, 0);

    lrd_bind_col(Csr2, 2, &LAST_NAME_D15, 0, 0);

    lrd_exec(Csr2, 0, 0, 0, 0, 0);

    lrd_fetch(Csr2, 3, 3, 0, PrintRow15, 0);

     /* VuGen returns a grid with three rows of data */

    lrd_cancel(0, Csr2, 2 /*Current*/, 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: