- Ran JDBC request and got result JDBC request : select id from epx.unavailability where startdate >= (NOW() - INTERVAL '7 days') and siteid='${su-siteid}';
Result: Please refer screen shot

Created HTTP request to delete records which is retrieved from the DB request.
It deleted first record but I want to delete all the records which is reteieved from the DB request.
I'm using ' JSR223 PreProcessor ' to HTTP request.
JSR223 PreProcessor: def Scenario = vars.get("Scenario") def unavailabilityid = vars.get("${unavailabilityid}")
if(Scenario.contains("epx_diary_Unavailability_Del_old")){ vars.put("unavailabilityid","${__groovy(vars.getObject('unavailabilityid')[0].get('id'),)}") }
Please let me know it's possible
If you set "Variable names" in JDBC Request sampler:
you will get the following JMeter Variables:
The
${id}variable can be used in ForEach ControllerForEach Controller will run its children as many times as there are "ids" returned by your SQL query and you will be able to refer the current "id" as
${id}in the HTTP Request sampler: