Share this page

# lrd_ora8_stmt_ext

Prepares an SQL statement with null characters, for execution.

    LRDRET lrd_ora8_stmt_ext( void *mpvLRDDBIHandleStmt, char *mpcStmtText, long mliStmtTextLen, long mliLanguage, long mliMode, int miDBErrorSeverity );

mpvLRDDBIHandleStmt | A non-null pointer to an LRDDBI Statement Handle.
mpcStmtText | A pointer to null-terminated SQL statement text.
mliStmtTextLen | The length of the statement text.
mliLanguage | One of the LRD_LANGUAGE_ options.
mliMode | The database mode.
miDBErrorSeverity | The Error Severity Levels of a failure in a database routine.

The lrd_ora8_stmt_ext function prepares an SQL or PL/SQL statement for execution. The statement text is specified by an address and an explicit length. The text may contain null characters and should be terminated with a null character. Use lrd_ora8_stmt_ext with dynamically constructed storage areas that may contain embedded null-characters.

If one lrd_ora8_stmt_ext function is followed by another (without an lrd_ora8_exec in between), the strings are concatenated. Note that a single handle can support multiple, successive SQL statements. Although you can split SQL statement text into several segments, you cannot split a placeholder identifier.

The lrd_ora8_exec function resets the contents of the SQL statement set by lrd_ora8_stmt; you must provide a new SQL statement after every lrd_ora8_exec function call.

For more details refer to the Function Header File lrd.h in the include directory.

## Return Values

See LRD Return Values.

## Parameterization

The following argument can be parameterized using standard parameterization: mpcStmtText

## Example

In the following example, the lrd_ora8_stmt_ext function sets an SQL statement specifying its length that selects all of the database records in the user_objects table.

Copy code

    lrd_ora8_stmt_ext(OraStm3, "select * from user_objects\n", 23, 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: