How to read in multiple parameter values from a file for a load scenario.
Use $BFFileArray to read in a parameter file for the script in the scenario. Replace the parameters with the $BFFileArray function.
The function will return a single value. If the parameter needs a string value, the $BFFileArray function needs to be enclosed in the proper quotation marks.
Example:
A scenario runs a SQL query:
select * from tableA where name_string = 'Smith'
Replace with:
select * from tableA where name_string ='$BFFileArray("C:\test_param.txt",RANDOM,2)'
$BFFileArray("C:\test_param.txt",RANDOM,2) returns the value Smith (without any quotations. For the query to work the parameter needs to be in quotes so the whole function needs to be enclosed in the proper quotes.
If multiple parameter values are needed, multiple $BFFileArray can be listed in the proper script format in place of the parameters.
Example:
A scenario runs a SQL query:
exec dbo.lookUp 100, 'Smith'
Replace with:
exec dbo.lookUp $BFFileArray("C:\test_param.txt",RANDOM,1),
'$BFFileArray("C:\test_param.txt",RANDOM,2)'
The script runs a stored procedure lookUp which takes in 2 parameters, an integer and a sting. $BFFileArray("C:\test_param.txt",RANDOM,1) returns the value 100. $BFFileArray("C:\test_param.txt",RANDOM,2) returns the value Smith. The functions are listed following the stored procedure name and are separated by a comma. Note that since the first parameter needed by the procedure is an integer, quotations are not needed around the first $BFFileArray function.
Information about $BFFileArray Benchmark Factory scripting function:
Syntax: $BFFileArray(FileName, Retrieval Mode[,nColumn][, nRow])
Selects an item from a list. Returns a single item from a comma-delimited file. The item returned depends on the mode selected. The syntax of the statement is also slightly different for each mode. Each virtual user gets a different seed value to generate unique sequences. Each agent machine must have a file with the name and path that is specified in the script function. If $BFFileArray is to return strings, the items in the file must be in double-quotes.
More details about scripting options and $BFFileArray can be found in the Help files in BMF.
© ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center