lr_save_string
Saves a null-terminated string to a parameter.
int lr_save_string( const char *param_value, const char *param_name);
| Alphabetical Listing - C Language Utility Functions |
Arguments
| Name | Comments |
|---|---|
| param_value | The value to assign to the parameter. |
| param_name | The name of the parameter. (Case sensitive) |
The lr_save_string function assigns the specified null-terminated string to a parameter. This function is useful in correlating queries. To determine the value of the parameter, use the lr_eval_string function.
Return Values
This function returns LR_PASS (0) on success, and LR_FAIL (1) on failure.
Parameterization
You cannot use standard parameterization for any arguments in this function.
Example
In the following example, lr_save_string assigns 777 to a parameter emp_id. This parameter is then used in another query.
lrd_stmt(Csr1, "select id from employees where name='John'", ...); lrd_bind_col(Csr1,1,&ID_D1,...); lrd_exec(Csr1, ...); lrd_fetch(Csr1, 1, ...);
ID_D1 | |
0 | 777 |
lr_save_string("777", "emp_id");
lrd_stmt(Csr1,"select salary from payment where id ='{emp_id}'",...);
lrd_exec(Csr1, 0, 0, 0, 0, 0);

