Execute inner scenarios in the loop using SQL