Is NextResultSet implemented for driver.Rows in go-ora?
I am using go_ora.Connection.QueryContext(...) that returns driver.Rows.
I want to use NextResultSet call like in database/sql:Rows
go-ora version: 2.8.19
What I am trying to do:
...
conn, err := go_ora.NewConnection(connectionString, nil)
if err != nil {
return err
}
...
err = conn.Open()
if err != nil {
return err
}
...
driverRows, err := conn.QueryContext(ctx, query, args...)
if err != nil {
return err
}
...
// driverRows.NextResultSet()?
for driverRows.NextResultSet() {
for driverRows.Next(values) == nil {
...
}
}
Maybe I should use as in Golang standard library?
nextResultSet, ok := rs.rowsi.(driver.RowsNextResultSet)
if !ok {
doClose = true
return false
}
// Lock the driver connection before calling the driver interface
// rowsi to prevent a Tx from rolling back the connection at the same time.
rs.dc.Lock()
defer rs.dc.Unlock()
rs.lasterr = nextResultSet.NextResultSet()
if rs.lasterr != nil {
doClose = true
return false
}
I tried to find implementation of NextResultSet in go-ora source code same as in godror:
https://github.com/godror/godror/blob/010a6de91d2687e91c1563126d3b76578c9771b5/rows.go#L776-L814
But only found this commented line: https://github.com/sijms/go-ora/blob/78d53fdf18c31d74e7fc9e0ebe49ee1c6af0abda/v2/data_set.go#L24
As I see DataSet does not implement NextResultSet as DataSet can not be converted to driver.RowsNextResultSet
would you please give me example query that return multiple result set to test ad is that equal to returning multiple ref cursor from pl/sql block which I think is supported
@sijms see https://python-oracledb.readthedocs.io/en/latest/user_guide/plsql_execution.html#implicit-results
as I expected the execution will go to the line 1028 in command.go this area of code is incomplete I will complete and test
support added in v2.9.0 and example code is present here