sql.call
hasil ke GroovyResultSet
. Anda seharusnya dapat melakukan eachRow
pada resultet dan dorong ke daftar.
def listPeople(){
Sql sql = new groovy.sql.Sql(dataSource)
def resultList = []
sql.call("BEGIN mypackage.p_get_people(?); END;",
[Sql.resultSet(OracleTypes.CURSOR)]) {cursorResults ->
cursorResults.eachRow{result ->
resultList << result
}
}
return resultList
}
EDIT:
Atau gunakan sql.eachRow
sql.eachRow("BEGIN mypackage.p_get_people(?); END;",
[Sql.resultSet(OracleTypes.CURSOR)]) {row ->
resultList << row
}