Share this page

# lrd_ora8_exec

Executes an SQL statement in Oracle 8.x.

    LRDRET lrd_ora8_exec( void *mpvLRDDBIHandleSvcCtx, char *mpvLRDDBIHandleStmt, unsigned long muliTotalRows, unsigned long muliSkipRows, unsigned long *mpuliRowsProcessed, LRD_ORA8_PRINT_ROW_TYPEDEF mpfjPrintRow, void *Reserved1, void *Reserved2, long mliMode, int miDBErrorSeverity );

mpvLRDDBIHandleSvcCtx | A pointer to an LRDDBI Service Context Handle.
mpvLRDDBIHandleStmt | A non-NULL pointer to an LRDDBI Stmt Handle.
muliTotalRows | The total number of rows in the placeholder arrays or the number of times to execute the statement for non-query statements.
muliSkipRows | For queries, 0. For non-query statements, the number of rows to be skipped in the placeholder arrays.
mpuliRowsProcessed | The number of rows to be processed.
mpfjPrintRow | A pointer to a printing function. Pass 0.
Reserved1 | Pass 0.
Reserved2 | Pass 0.
mliMode | The database mode. The default mode is 0.
miDBErrorSeverity | The Error Severity Levels of a failure in a database routine.

The lrd_ora8_exec function executes an SQL statement set by lrd_ora8_stmt. This function resets the contents of the SQL statement set by lrd_ora8_stmt; you must provide a new SQL statement (and optionally bind the parameters) after every lrd_ora8_exec function call.

Note: To repeat a query, you must reissue an lrd_ora8_stmt function.

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

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

The database mode, mliMode, can be one of:

- 0 - Default
- 16 - Describe only. Obtain a description of the columns used in the statement, but don't execute the statement.
- 32 - Commit on success. Commit the changes to the database if the statement execution succeeded.

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, an SQL statement selects all of the database records in the user_objects table. lrd_ora8_exec executes the statement after binding the host variables, OBJECT_NAME_D17, SUBOBJECT_NAME_D18, etc.

    lrd_ora8_stmt(OraStm3, "select * from user_objects\n", 1, 0, 0);
    lrd_ora8_exec(OraSvc1, OraStm3, 0, 0, &uliRowsProcessed, 0, 0, 0, 0, 0);
    lrd_attr_set_ora(OraDef2, CHARSET_FORM, "1", -1, 0);
    lrd_attr_set_ora(OraDef3, CHARSET_FORM, "1", -1, 0);
    lrd_attr_set_ora(OraDef6, CHARSET_FORM, "1", -1, 0);
    lrd_ora8_bind_col(OraStm3, &OraDef2, 1, &OBJECT_NAME_D17, 0, 0);
    lrd_ora8_bind_col(OraStm3, &OraDef3, 2, &SUBOBJECT_NAME_D18, 0, 0);
    lrd_ora8_bind_col(OraStm3, &OraDef4, 3, &OBJECT_ID_D19, 0, 0);
    lrd_ora8_bind_col(OraStm3, &OraDef5, 4, &DATA_OBJECT_ID_D20, 0, 0);
    lrd_ora8_bind_col(OraStm3, &OraDef6, 5, &OBJECT_TYPE_D21, 0, 0);
    lrd_ora8_bind_col(OraStm3, &OraDef7, 6, &CREATED_D22, 0, 0);
    lrd_ora8_fetch(OraStm3, -75, 15, &uliFetchedRows, PrintRow11, 2, 0, 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: