Share this page

# lrd_assign_bind_ext

Assigns a storage area with an explicit length to a variable and binds it to a placeholder.

    LRDRET lrd_assign_bind_ext( LRD_CURSOR *mptCursor, char *mpszPlaceholder, char *mpcValStr, long mliValStrLen, LRD_VAR_DESC *mptVarDesc, char *mpszValStrFmt, unsigned long muliOption, int miDBErrorSeverity );

mptCursor | A pointer to an LRD_CURSOR structure.
mpszPlaceholder | A pointer to a string containing the placeholder name.
mpcValStr | A pointer to the input value string, or NULL. If the value is not NULL, the string can be parameterized.
mliValStrLen | The length of the string.
mptVarDesc | A pointer to the descriptor of a variable being bound.
mpszValStrFmt | The input value format: LRD_VAL_STR_FMT_ type where type can be DFLT or RAW.
muliOption | One of the Binding Options
miDBErrorSeverity | The Error Severity Levels of a failure in a database routine.

The lrd_assign_bind_ext function assigns a storage area with an explicit length to a scalar variable via its descriptor, and binds the variable to a placeholder. If necessary, the value is converted to the variable's type and length. The value can contain embedded null characters ('\0'). You can also specify a NULL value using NULL or 0 (without quotation marks). This function performs the functions of both lrd_assign_ext and lrd_bind_placeholder, but it is limited to scalar type variables.

Note that this function is not recorded during a database session—you must insert it manually. It is useful for applications using bitmaps or other applications where the length of the value is not known, and the values contain null characters.

To use the values from a storage area such as an array, you:

1. Modify the function name from lrd_assign_bind or lrd_assign_bind_literal, to lrd_assign_bind_ext.

2. Replace the string with a variable containing the values.

3. Specify a length for the string.

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: mpcValStr

## Example

In the following example, lrd_assign_bind_ext assigns the contents of the array emp to the host variable newemp_D4 , and then binds the host variable to the placeholder. The array emp, contains the required values, and it was defined as int emp[15] at the beginning of the script.

The actual recorded code was:

    lrd_stmt(Csr1, "insert into employee values ('Joe Taylor',:newemp," "'1-JAN-97','R&D',22)", -1, 0 /*Non deferred*/, 2 /*Ora V7*/, 0);

    lrd_assign_bind(Csr1, "newemp", "70", &newemp_D4, 0, 0, 0);

    lrd_exec(Csr1, 0, 0, 0, 0, 0);

    If the names contain null characters and are variable length, you modify the existing code in the following way:

    lrd_assign_bind_ext(Csr1, "newemp", emp[1], 9, &newemp_D4, 0, 0, 0);

    lrd_exec(Csr1, 0, 0, 0, 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: