Call stored procedure in groovy and retrieve the OUT parameter and Cursor

954 Views Asked by At

I have a Stored Procedure that returns a VARCHAR OUT and a Cursor. The rows is always null and I need the result set in it. How do I get it? I get the OUT value in iStatus as expected.

def rows = sql.call stmt, parameters, { it ->
   iStatus = it
}
1

There are 1 best solutions below

0
On

You are probably looking for Sql#callWithRows() or Sql#callWithAllRows().

There are two variations for each of the methods. One with GString and the other with List of parameters.

It's quite new feature though so you may need to update Groovy version.