You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can you try gopkg.in/goracle.v2 ?
Just blank import it (import _ "gopkg.in/goracle.v2") instead of gopkg.in/rana/ora.v4 and use
db, err := sql.Open("goracle", "...")
...
and when you run your test, set the "DPI_DEBUG_LEVEL" environment variable to something bigger than 0. This will print a lot of debug information. Then the ODPI-C folks may be able to help.
hello,
i am making updates to oracle version 12.2.0.1 & ORA.V4 and using the following code snippet..
func (o *Oracle) UnReserveCdb(cdbname string) (unreserved bool, err error) {
fmt.Println(cdbname)
udb := o.Db
utx, err := udb.Begin()
if err != nil {
fmt.Println("error", err)
}
ures, err := utx.Exec("update testdb.DATABASE_INFO set CDB_CONSUMED = 'YES' , CDB_AVAILABLE = 'NO' where CDB_NAME = :1", cdbname)
if err != nil {
fmt.Println("error in exec: ", err)
utx.Rollback()
return unreserved, err
}
if err := utx.Commit(); err != nil {
fmt.Println("error", err)
}
urowCnt, err := ures.RowsAffected()
if err != nil {
fmt.Println("error", err)
}
fmt.Println("rows changed ", urowCnt)
if urowCnt > 0 {
return true, err
} else {
return false, err
}
}
type Oracle struct {
Driver string
ConnectString string
Db *sql.DB
logger log.Logger
}
func NewOracleConnection(cfg config.Config, log log.Logger) (Connection, error) {
var err error
o := &Oracle{
Driver: cfg.DB.Driver,
ConnectString: cfg.DB.ConnectString,
logger: log,
}
o.Db, err = sql.Open(o.Driver, o.ConnectString)
if err != nil {
log.Log("event", "connecting to database", "err", err.Error())
}
return o, err
}
thanks
Chakri
The text was updated successfully, but these errors were encountered: