Share this page

# lrd_ora8_fetch

Fetches the next row in the result set.

    LRDRET lrd_ora8_fetch( void *mpvLRDDBIHandleStmt, long mliRequestedRows, long mliRowsBatchSize, unsigned long *mpuliFetchedRows, LRD_PRINT_ROW_TYPEDEF mpfjPrintRow, long mliOrientation, long mliMode, int miDBErrorSeverity );

mpvLRDDBIHandleStmt | A non-NULL pointer to an LRDDBI Stmt Handle.
mliRequestedRows | The total number of rows to be fetched. A zero value fetches one row. A negative value fetches all rows.
mliRowsBatchSize | The maximum number of rows to be fetched by a single database request.
mpuliFetchedRows | A pointer to the actual number of rows fetched.
mpfjPrintRow | A pointer to a function that prints each fetched row.
mliOrientation | The orientation.
mliMode | The database mode.
miDBErrorSeverity | The Error Severity Levels of a failure in a database routine.

The lrd_ora8_fetch function fetches the next row from the result set. In recorded scripts, the number of rows in the result set is the absolute value of the parameter, mliRequestedRows. For example, if the second parameter of lrd_ora8_fetch is -14, fourteen rows of data were retrieved.

lrd_ora8_fetch(OraStm1, -14, 1, 0, PrintRow24,0,0,0);

If the second parameter has a negative value, it indicates that all the rows in the result set were retrieved. A positive value indicates that only a portion of the results were retrieved.

Note: When you execute an lrd_ora8_fetch statement containing a negative row value, it retrieves all of the available rows in the table at the time of the run—not necessarily the number at the time of recording. In the above example, all fourteen rows of the table were retrieved during the recording session. However, if more rows are available during script execution, they are all retrieved.

A single SQL statement can return multiple result sets. This function gets the next row from the current result set. If there are no more rows in the current result set, the next result set is made available.

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);
     /* All seventy-five rows of the result set were fetched */

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: