Share this page

# lrd_ora8_save_col

Saves the value of a table cell to a parameter.

    LRDRET lrd_ora8_save_col( void *mpvLRDDBIHandleStmt, unsigned int muiColNum, long mliRowNum, unsigned long muliOption, char *mpszParamName );

mpvLRDDBIHandleStmt | A non-NULL pointer to an LRDDBI Statement Handle.
muiColNum | The column number of the value to save.
mliRowNum | The row number of the value to save. To save the last row, set the row number to zero.
muliOption | One of the Save Column Options.
mpszParamName | A parameter name using alpha-numerical characters, enclosed by quotation marks.

The lrd_ora8_save_col function saves the dynamic value of a specified table cell and assigns it to a parameter. This function is used for Correlating Statements and other SQL statements within a script. Instead of using the actual result fetched during a query, you replace the constant value with a parameter. This parameter can then be used by other database statements within the same script. Note that lrd_ora8_save_col always precedes an lrd_ora8_fetch statement.

If no rows are fetched, the parameter is marked as uninitialized. If less rows are fetched than the specified row number, the value from the last fetched row is saved. The column value is obtained for columns previously specified by lrd_ora8_bind_col . When more than one lrd_ora8_save_col is issued for the same column, only the most recent lrd_ora8_save_col applies.

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 lrd_ora8_save_col function saves the value in the first row and column to the variable, ObjectName. You can use this variable at a later stage in the script.

    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_save_col(OraStm3, 1, 1, 0, "ObjectName");

    lrd_ora8_fetch(OraStm3, -75, 15, &uliFetchedRows, PrintRow11, 2, 0, 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: