Highlighted
Respected Contributor.
Respected Contributor.
1114 views

Get unique value from VTS

Hi,

 

I have installed VTS 2 and upload the datafile...

I am able to connect to VTS from my loadrunner script...

I would like to get unique value from VTS table to use in my script.

I found only 2 query methods

lrvtc_query_column

lrvtc_query_row

 

Query_column has the input params of column name and row number.

Is it possible to get next available unique value from particular column by just specifying column name.

If so, whats the method to get next available unique value from a column?

Thanks in advance.

0 Likes
4 Replies
Highlighted
Absent Member.. Absent Member..
Absent Member..

VTS is a simple table structure. It has no knowledge or constraints on content, so "unique" is irrelevant here. You can only retrieve whatever data you have addedd to VTS, either by querying by row and column or by reading and removing (or "popping") the last entry. If that data is unique, that's fine.

Could you supply an example set of data rows (just a few) and how you are using the data?

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Thanks Dave. i have unique data in VTS table. I was looking for a method to retrieve and delete the first entry.

tried few methods... vtc_retrieve_message is doing the job for me... Thanks....

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Great.

 

This is the simplest method of popping a record

The column names become the parameter names - just use those you need.

 

lrvtc_connect(VTS_IP, VTS_PORT, VTOPT_KEEP_ALIVE);
lrvtc_retrieve_row();

lrvtc_disconnect();


0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Hello,

 

     It has been 4 or 5 years since I last played with the VTS, and I no longer have access to the scripts, but in essence, how I did this was roughly as follows:

 

     1. Connect to the VTS

     2. Used a loop to query each row starting from the top each row starting from the top for first an unlocked cell (explained next) and than an unmodified cell (explained later).

     3. Once both filters in 2 are found, I enter a lock on that row (a simple 1 in the lock column)

     4. Grab the data from the column needed

     5. Set the modified column to 1

     6. Set the the row to unlocked

 

     This seems like a lot of steps and the other commenters suggestion of the pop method may prove helpful. But the above steps allowed me to use that same table and data for other portions/scripts that needed modified data.

 

Tom Johnson  

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.