lrd_assign_bind_literal

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.

Parameterization

The following argument can be parameterized using standard parameterization: mpcValStr

Example

In the following example, lrd_assign_bind_literal assigns the value 70\0\0 to the placeholder newemp. It then binds the host variable newemp_D4 to the placeholder.

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_literal(Csr1, "newemp", "70\x00\x00", &newemp_D4, 0, 0, 0);
lrd_exec(Csr1, 0, 0, 0, 0, 0);