lrd_assign_bind
Assigns a null-terminated string to a variable via its descriptor, and binds it to a placeholder.
LRDRET lrd_assign_bind( 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 function assigns a null-terminated string value to a scalar variable and binds the variable to a placeholder. If the string is not null-terminated, use lrd_assign_bind_ext or lrd_assign_bind_literal. This function performs the functions of both lrd_assign 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 assigns the value 70 to the placeholder newemp. It then binds the host variable newemp_D4 to the placeholder.
/* Insert a new record into the employee table using the placeholder newemp for the id. */lrd_stmt(Csr1, "insert into employee values ('Joe Taylor',:newemp," "'1-JAN-97','R&D',22)", -1, 0 /*Non deferred*/, 2 /*Ora V7*/, 0);/* Assign the constant 70 to the placeholder and bind the host variable to the placeholder. */
lrd_assign_bind(Csr1, "newemp", "70", &newemp_D4, 0, 0, 0);
lrd_exec(Csr1, 0, 0, 0, 0, 0);

