lrd_send_data

Example: lrd_send_dataStatement Handling Functions

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