We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import ( "log" "github.com/jmoiron/sqlx" go_ora "github.com/sijms/go-ora/v2" )
connStr := go_ora.BuildUrl(HOST, PORT, SERVICE_NAME, USER, PASSWORD, map[string]string{}) db, err := sqlx.Open("oracle", connStr) if err != nil { log.Fatalf("open %s", err) return } err = db.Ping() if err != nil { log.Fatalf("ping %s", err) return } slice := []int{1} query, args, err := sqlx.In("SELECT 1 FROM dual WHERE rownum IN (?)", slice) if err != nil { log.Fatalf("prepare %s", err) } _, err = db.Query(db.Rebind(query), args...) if err != nil { log.Fatalf("IN query %s", err) }
IN query ORA-00911: invalid character
The same code works well with Godror.
The text was updated successfully, but these errors were encountered:
workaround for jmoiron/sqlx#854
1b8d098
79e473a
I ran into a similar issue, and I believe this is because the go-ora "oracle" driver doesn't have a default bind type.
I set this before the Rebind:
sqlx.BindDriver("oracle", sqlx.NAMED)
Otherwise, this can be fixed with #856.
Sorry, something went wrong.
No branches or pull requests
import ( "log" "github.com/jmoiron/sqlx" go_ora "github.com/sijms/go-ora/v2" )
connStr := go_ora.BuildUrl(HOST, PORT, SERVICE_NAME, USER, PASSWORD, map[string]string{})
db, err := sqlx.Open("oracle", connStr)
if err != nil {
log.Fatalf("open %s", err)
return
}
err = db.Ping()
if err != nil {
log.Fatalf("ping %s", err)
return
}
slice := []int{1}
query, args, err := sqlx.In("SELECT 1 FROM dual WHERE rownum IN (?)", slice)
if err != nil {
log.Fatalf("prepare %s", err)
}
_, err = db.Query(db.Rebind(query), args...)
if err != nil {
log.Fatalf("IN query %s", err)
}
IN query ORA-00911: invalid character
The same code works well with Godror.
The text was updated successfully, but these errors were encountered: