Example: lrd_assign_bind_literalVariable Handling Functions

Assigns a literal string to a scalar variable via its descriptor and binds it to a placeholder.

LRDRET lrd_assign_bind_literal( LRD_CURSOR *mptCursor, char *mpszPlaceholder, char *mpcValStr, 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.
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_literal function assigns function assigns a literal string value, enclosed by quotation marks, to a scalar variable via its descriptor, and then binds the variable to a placeholder in the SQL statement text. 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).

The length of the string is determined by (sizeof(string) -1). This function performs the functions of both lrd_assign_literal and lrd_bind_placeholder, but it is limited to scalar type variables.

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