background image
<< Modifying Error Handling Globally | CtLib Result Set Errors >>
<< Modifying Error Handling Globally | CtLib Result Set Errors >>

Modifying Error Handling Locally

Creating Vuser Scripts
Chapter 9, page 158
Database Vuser Scripts · Developing Database Vuser Scripts
In
Modifying Error Handling Locally
You can set error handling for a specific function by modifying the severity level.
Functions such as lrd_stmt and lrd_exec, which perform database operations,
use severity levels. The severity level is indicated by the function's final parameter,
miDBErrorSeverity
. This parameter tells LoadRunner whether or not to continue
script execution when a database error occurs (error code 2009). The default, 0,
indicates that LoadRunner should abort the script when an error occurs.
For example, if the following database statement fails (e.g., the table does not
exist), then the script execution terminates.
To tell LoadRunner to continue script execution, even when a database operation
error occurs for that function, change the statement's severity parameter from 0 to
1.
When the severity is set to 1 and a database error occurs, a warning is issued. Note
that the severity level set for a particular function applies only to that function.
lrd_stmt(Csr1, "insert into EMP values ('Smith',301)\n", -1, 1 /*Deferred*/,
1 /*Dflt Ora Ver*/, 0);
lrd_stmt(Csr1, "insert into EMP values ('Smith',301)\n", -1, 1 /*Deferred*/,
1 /*Dflt Ora Ver*/, 1);