Example: lrd_assign_bind_extVariable Handling Functions

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.


The following argument can be parameterized using standard parameterization: mpcValStr