What type is used in golang to receive the sys_refcursor returned by Oracle stored procedures?

Code:

stmt, err := db.Prepare("begin TestPro(:1,:2,:3);end;")
if err != nil {
    return "",err
}
defer stmt.Close()
var mail string = "1"
var pwd string = "2"
var op_re_list string
var result sql.Result
result,err = stmt.Exec(mail,pwd,sql.Out{Dest: &op_re_list})

if err != nil {
    log.Fatal(err)
}

the type of op_re_list is sys_refcursor

report type errors directly with string type

18:52:45 on 2018-04-26 ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to "TESTPRO"

Mar.07,2021

you can use interface and then reflect to see the corresponding type

Menu