Forum Discussion

Jseban's avatar
Jseban
Occasional Contributor
8 years ago

Looping through JDBC response xml

I am trying to write the results of a JDBC query result to an excel sheet. In my code I am looping through each element using a for loop. But when I use the looping variable(i) inside the context.expand variable, it is not giving me any results.

 

Ex. context.expand( '${JDBCRequest#ResponseAsXml#//Row[i]/FirstColumn}' )

 

If I change this to Row[1], I am getting the expected result. Could someone please help me to resolve this issue?

  • nmrao's avatar
    nmrao
    Champion Level 3
    Please show raw response? what is issue if you get expected result?
  • Jseban's avatar
    Jseban
    Occasional Contributor
    I get the result only if I use Rows[1]. But its not giving me result if I use like Rows[i]. I want to use context.expand( '${JDBCRequest#ResponseAsXml#//Row[i]/FirstColumn}' ) inside a for loop to get all the rows from the query result.

    Thank you