Reputation: 2321
My test has 2 JDBC Requests.
I'd like to use the results of the first JDBC Request in the WHERE clause of the second JDBC request.
For example, querying a DB2 database, I have tried:
select member_id from Employees fetch first 1 row only
select bonus_amount from EmployeesBonuses where member_id = '${JDBC Request 1#ResponseAsXml#//MEMBER_ID}'
Unfortunately, this method of referencing doesn't work. Further, the 2 steps above reference different databases, so constructing a join'd statement is not possible.
Upvotes: 0
Views: 913
Reputation: 21389
It is because Property Expansion does not work in sql query of Jdbc Request step.
Instead, have the query for 2nd as given below:
select bonus_amount from EmployeesBonuses where member_id = :MEMBERID
Above to the sql query, SoapUI allows to define the parameters. Define a parameter, MEMBERID
and provide the value as Property Expansion i.e., ${#JDBC Request 1#ResponseAsXml#//MEMBER_ID}
.
Now, try executing the query. For more details of query parameterization in SoapUI, refer documentation
Upvotes: 1