Share this page

# lrd_exec

Executes an SQL statement.

    LRDRET lrd_exec( LRD_CURSOR *mptCursor, unsigned long muliTotalRows, unsigned long muliSkipRows, unsigned long *mpuliRowsProcessed, long mliOption, int miDBErrorSeverity );

mptCursor | A pointer to an LRD_CURSOR structure.
muliTotalRows | Oracle only–The total number of rows in the placeholder arrays. 0 for all other databases.
muliSkipRows | Oracle only–The number of rows to be skipped in the placeholder arrays. 0 for all other databases.
mpuliRowsProcessed | Oracle only–The number of rows that were processed. NULL for all other databases
mliOption | One of the Execution Options.
miDBErrorSeverity | The Error Severity Levels of a failure in a database routine.

The lrd_exec function executes an SQL statement set by lrd_stmt.

This function resets the contents of the SQL statement set by lrd_stmt; you must provide a new SQL statement (and optionally bind the parameters) after every lrd_exec function call. To repeat a query, you must reissue an lrd_stmt function.

If you are using placeholders, the host variables must be bound to placeholders using lrd_bind_placeholder, before calling lrd_exec.

You can determine whether or not an update succeeded by evaluating the fourth parameter, mpuliRowsProcessed. Pass a pointer to this parameter and check its value for each lrd_exec statement.

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 in the employee table. lrd_exec executed the statement after the host variables, NAME_D11 and ID_D12, were bound.

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

    lrd_stmt(Csr1, "select * from employee\n", -1, 1 /*Deferred*/,1 /*Dflt Ora Ver*/, 0);
    lrd_bind_col(Csr1, 1, &NAME_D11, 0, 0);
    lrd_bind_col(Csr1, 2, &ID_D12, 0, 0);
    lrd_exec(Csr1, 0, 0, 0, 0, 1);
    lrd_fetch(Csr1, -3, 15, 0, PrintRow14, 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: