Highlighted
Absent Member.
Absent Member.
895 views

How to parameterize or pass the value from previous step for a SQL Query in HP UFT Api test step

How to parameterize or pass the value from previous step for a SQL Query in HP UFT Api test step.

Tried to pass the complete property name, but it didn't work.

Following is the example:

select empID from employee where empid=12345

Wanted to pass the value form previous instead of actual value 12345

 

0 Likes
1 Reply
Highlighted
New Member.

Say you first query is;

SELECT EMP_ID FROM EMPLOYEES;

and your record set object is oRec1 for above query. You can assign the value to some variant and access in your 2nd query like;

strEmpID = oRec1.Fields("EMP_ID").Value  ' From first query results

SELECT * FROM EMP_BENEFITS WHERE EMP_ID = strEmpID '2nd query line.

Also take care of the corresponding record from the results based on your logic, loops, etc.

Accept as solution/Give Kudos to the author if the piece of information answered/helped you to solve your problem.
All the thoughts here are mine not related to my employer nor anyone.
Test Automation Ecstasy
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.