Closed thigaz closed 5 years ago
Please show me minimal code to reproduce.
@thigaz Could you please provide SQL and Go code to reproduce, or close this issue?
there you go (sorry for the long delay):
`package main
import ( "fmt" "log"
"github.com/jmoiron/sqlx"
"github.com/joho/godotenv"
_ "github.com/mattn/go-oci8"
)
var env = make(map[string]string)
func main() {
var err error
var datatemp string
if env, err = godotenv.Read("./Configuracoes/DB.ENV"); err != nil {
log.Fatal(err)
}
banco, err := sqlx.Open("oci8", fmt.Sprintf("%v/%v@%v", env["USUARIO"], env["SENHA"], env["SERVICO"]))
if err != nil {
log.Fatal(err)
}
defer banco.Close()
if _, err = banco.Exec(fmt.Sprintf("ALTER SESSION SET CURRENT_SCHEMA = %s", env["SCHEMA"])); err != nil {
log.Fatal(err)
}
if err = banco.QueryRowx( SELECT t.TDAT FROM pmobjt a, pmtext t WHERE a.OBJT = 1628249 AND a.cmmt = t.txid ORDER BY t.numr
).Scan(&datatemp); err != nil {
log.Fatal(err)
}
fmt.Printf(datatemp)
}`
Data in the field is a string with len=2024.
@thigaz Need sql as well.
@thigaz Need sql as well.
It's in the body of the message:
SELECT t.TDAT FROM pmobjt a, pmtext t WHERE a.OBJT = 1628249 AND a.cmmt = t.txid ORDER BY t.numr
@thigaz All the SQL. In this case it looks like the two create tables and all the relevant inserts.
But really want is wanted is a self contained example, with all the needed SQL, create tables, insert statements, select statements, any PL/SQL, etc.
It's a SAP PowerDesigner product database which I'm querying some fields. I didn't create the table nor its data. I'm able to retrieve the data using Goracle, but not with OCI8. I'll create a custom DB and see if I can simulate the same error.
Thank you. With a working example that reproduces the error, makes it so we can help reproduce and hopefully fix the issue.
This may just be a duplicate of https://github.com/mattn/go-oci8/issues/306 . If so, close this?
@mattn Close this?
You guys can close it. It's been some rough months here and I don't know when I'll have time to focus on this issue. If you can create a VARCHAR2 column limited to 2000 chars with 2024+ chars and read it normally, the problem may be on my DB.
Anyway, thanks for being interested on my problem!
@thigaz Welcome. Could you close it?
@mattn Please close this.
I was receiving the error above and coudn't figure out how to change the limit of the receiver. When I moved to Query(x) and Scan I stopped getting error, but received zero rows as response.
The string was from a VARCHAR2 with 2054 characters (the database field has a limitation of 2000 chars, don't know how it passed the limit, but there it was)
(the error ocurred with both queryrow and queryrowx)