background image
<< Protocol-Specific Functions | Using General Vuser Functions >>
<< Protocol-Specific Functions | Using General Vuser Functions >>

LRD functions

Creating Vuser Scripts
Chapter 2, page 20
Working with VuGen · Introducing VuGen
In
The following segment from a Database Vuser script uses a number of
LRD functions:
VuGen generates Vuser scripts in C. All standard C conventions apply to the
scripts, including control flow and syntax. You can add comments and conditional
statements to the script just as you do in other C programs. You declare and
define variables using regular C conventions.
Note: The C Interpreter used by LoadRunner accepts the ANSI C language. No
Microsoft extensions to ANSI C are supported. For more information about using
C functions in your scripts, refer to Chapter 4,
Enhancing Vuser Scripts
.
/*
* Code generated from recorded SQL by DB Virtual User Generator
* Session was recorded on: Wed Feb 19 09:06:23 1998
*/
#include "vdf.h"
#include "print.inl"
int LR_FUNC vuser_init(LR_PARAM p)
{
lrd_init(&InitInfo, DBTypeVersion);
lrd_open_connection(&Con1, LRD_DBTYPE_CTLIB, "s1",
"tiger", "hp1", "", 0, 0, 0);
lrd_open_cursor(&Csr1, Con1, 0);
lrd_open_cursor(&Csr2, Con1, 0);
lrd_stmt(Csr2, "select parameter, value from v$nls_parameters
" " where .. . .);. . .