Original post

Can some please help me or share some reference on how to call an Oracle Stored Procedure with IN and Out paramaters.
I tried a sample code and its fetching nothing.

package main

import (
“fmt”
“database/sql”
“gopkg.in/goracle.v2”
//“database/sql/driver”
)

func main() {
db, err := sql.Open(“goracle”, “cwwms/DCWms2016@qc-or-scan.fanatics.corp:1521/cwmdad1”)
if err != nil {
fmt.Println(err)
return
}
defer db.Close()

loginStmt,err:=db.Prepare(“begin loggggggin(:1,:2); end;” )
if err != nil {
fmt.Println(err)
return
}
defer loginStmt.Close()
var mail string = “1”
//var retVal string
var retVal string
pp, err := loginStmt.Exec(goracle.PlSQLArrays,mail,&retVal)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(pp)
fmt.Println(“return Value is = ” + retVal)
}

This is the body of the stored procedure:

create or replace PROCEDURE loggggggin(u_mail_in IN VARCHAR2,
retval OUT VARCHAR2)
AS
BEGIN
retval := ‘2’;

END loggggggin;

Here is the output:

C:GoCodeOracleTest> run .oracle-sp.
{0xc0000a2080 1}
return Value is =