Share this page

# lrd_send_data

Sends data to the server. (CtLib only)

    LRDRET lrd_send_data( LRD_CURSOR *mptCursor, unsigned int muiUnused, unsigned long muliIODescNum, char *mpszReqSpec, LRD_VAR_DESC *mptVarDesc, int miDBErrorSeverity );

mptCursor | A pointer to an LRD_CURSOR structure.
muiUnused | A reserved variable.
muliIODescNum | The I/O descriptor number (one-based, greater than 0).
mpszReqSpec | A pointer to the string containing the request specification using the format <keyword>=<value>. Multiple keywords should be separated by semicolons. The available keywords are TotalLen, Log, and Timestamp.
mptVarDesc | A pointer to the descriptor of the variable to be sent.
miDBErrorSeverity | The Error Severity Levels of a failure in a database routine.

The lrd_send_data function sends a block of data to the server. The location of the data is specified by the request specification string mpszReqSpec. This null-terminated string contains a list of keywords and their values.

The supported keywords are:

TotalLen=<total_txt_len>
Log=<log_on_update>
Timestamp=<timestamp>

<total_txt_len>: the length of the data block to be sent. This value will be used until it is reset by an lrd_exec function using the same cursor. The specified length must correspond to the exact sum of all the variable lengths sent.

<log_on_update>: 1 Log the column update
0 Do not log the column update.

<timestamp>: Include the timestamp of the item being updated.(generated optionally- see note below)

Note that all of the keyword settings are valid until the next lrd_exec, the execution of the database statement. Do not specify new keywords in subsequent lrd_send_data functions that are called before lrd_exec.

The first keywords, TotalLen and Log, are required in the first call to lrd_send_data following lrd_stmt. You separate keywords using a semicolon and keywords are not case sensitive.

By default, VuGen generates lrd_send_data statements with the TotalLen and Log keywords for the mpszReqSpec parameter.

To instruct VuGen to also generate the TimeStamp keyword, perform the following steps:

1. Choose Tools > Recording Options. Click the Advanced button and select the Generate send data time stamp check box.

2. Choose Tools > Regenerate Vuser.

It is not recommended to generate the Timestamp keyword by default. The timestamp generated during recording is different than that generated during replay and script execution will fail. You should use this option only after a failed attempt in running a script, where an lrd_result_set following an lrd_send_data fails. The generated timestamp can now be correlated with a timestamp generated by an earlier lrd_send_data.

For more details refer to the Function Header File lrd.h in the include directory.

## Return Values

This function returns 0 if it succeeds, and a negative error code if it fails.

## Parameterization

The following argument can be parameterized using standard parameterization: mpszReqSpec

## Example

In the following example, the lrd_data_info function specified the I/O descriptor number, 1. The lrd_send_data function, using this I/O descriptor number, sends characters to the server as specified by the TotalLen keyword. Note that lrd_data_info and lrd_send_data do not need to use the same cursor, only the same I/O descriptor.

If timestamp was activated, it appears in the after running the code.

Copy code

    lrd_open_cursor(&Csr9, Con1, 0);
    lrd_stmt(Csr9, "select * from sampletext", -1, 148, -99999, 0);
    lrd_exec(Csr9, 0, 0, 0, 0, 0);
    lrd_result_set(Csr9, 1 /*Succeed*/, 4040 /*Row*/, 0);
    lrd_bind_cols(Csr9, BCInfo_D2, 0);
    lrd_fetch(Csr9, 1, 0, 0, PrintRow1, 0);
    lrd_data_info(Csr9, 2, 1, "", 0);
    lrd_bind_cols(Csr9, BCInfo_D4, 0);
    lrd_fetch(Csr9, 0, 0, 0, PrintRow2, 0);

    /* Note: no rows returned by above lrd_fetch */
    lrd_result_set(Csr9, -205 /*End results*/, 4046 /*Done*/, 0);
    . . .
    lrd_open_cursor(&Csr10, Con2, 0);
    lrd_stmt(Csr10, "", -1, 151, 193, 0);
    lrd_assign(&_2_D5, "T", 0, 0, 0);
    lrd_send_data(Csr10, "", 1, "TotalLen=45;Log=1", &_2_D5, 0);
    lrd_assign(&_2_D6, "h", 0, 0, 0);
    lrd_send_data(Csr10, "", 1, "", &_2_D6, 0);
    lrd_assign(&_2_D7, "i", 0, 0, 0);
    lrd_send_data(Csr10, "", 1, "", &_2_D7, 0);
    lrd_assign(&_2_D8, "s", 0, 0, 0);
    ...
    lrd_send_data(Csr10, "", 1, "", &_2_D49, 0);
    lrd_exec(Csr10, 0, 0, 0, 0, 0);
    lrd_result_set(Csr10, 1 /*Succeed*/, 4042 /*Param*/, 0);
    lrd_bind_cols(Csr10, BCInfo_D51, 0);
    lrd_fetch(Csr10, 1, 0, 0, PrintRow3, 0);

Tips to improve your search results... VuGen Function Reference Version 26.1-26.3 Function Reference 26.1-26.3 All View Local Help Center View Online Help Center Version: