lrd_save_ret_param

Saves a return-parameter to a parameter

LRDRET lrd_save_ret_param( LRD_CURSOR *mptCursor, unsigned int muiRetParamNum, unsigned long muliOption, char *mpszParamName );


mptCursor A pointer to an LRD_CURSOR structure.
muiRetParamNum A "0" indicates the return status. A non-zero value indicates the return-parameter number (DbLib).
muliOption One of the Save Return Parameter Options.
mpszParamName A pointer to the parameter name using alpha-numerical characters, enclosed by quotation marks.

The lrd_save_ret_param function saves the value of a stored procedure's return-parameter, to a parameter. If the function cannot retrieve the return-parameter, the parameter is marked as uninitialized. This function is used for Correlating Database Statements.

To generate an lrd_save_ret_param function, right click on the value in the grid that you want to correlate (following lrd_result_set) and choose Create Correlation. After prompting you for a parameter name, VuGen places an lrd_save_ret_param function before the grid.

For more details refer to the DbLib documentation for dbretdata and the Function Header File, Lrd.h.

Return Values

See LRD Return Values.

Parameterization

You cannot use standard parameterization for any arguments in this function.

Example

In the following example, the lrd_save_ret_param function, saved two return parameters to parameters. VuGen recorded the call to a stored procedure, and lrd_save_ret_param saved the return values of the stored procedure to the parameters Saved_return_status and Saved_name1_out.

The original script shows the result grid directly after the lrd_result_set function.
lrd_bind_placeholder (Csr1, "name15_out", &name15_out_D31, 0, 0); 
lrd_assign_literal (&name16_out_D32, "\xFE\x00\x00\x00\. . . ", 0, 0, 0); lrd_bind_placeholder(Csr1, "name16_out", &name16_out_D32, 0, 0);
lrd_exec(Csr1, 0, 0, 0, 0, 0);
lrd_result_set(Csr1, 0 /*Succeed*/, 0, 0);
lrd_result_set(Csr1, 1 /*No results*/, 0, 0);

After correlation, the lrd_save_ret_param function appears in the script. In this example, lr_output_message displays the value of the parameter.

lrd_bind_placeholder (Csr1, "name15_out", &name15_out_D31, 0, 0); 
lrd_assign_literal (&name16_out_D32, "\xFE\x00\x00\x00\. . . ", 0, 0, 0); lrd_bind_placeholder(Csr1, "name16_out", &name16_out_D32, 0, 0);
lrd_exec(Csr1, 0, 0, 0, 0, 0);
lrd_result_set(Csr1, 0 /*Succeed*/, 0, 0);
lrd_save_ret_param(Csr1,0,1,"Saved_return_status");
lrd_save_ret_param(Csr1,1,0,"Saved_name1_out");

lr_output_message("********** %s ******",lr_string("<Saved_return_status>"));
lr_output_message("*********** %s *******",lr_string("<Saved_name1_out>"));
lrd_result_set(Csr1, 1 /*No results*/, 0, 0);