sijms / go-ora

Pure go oracle client
MIT License
771 stars 169 forks source link

Problem with CLOB type input parameters. #490

Closed fitlcarlos closed 7 months ago

fitlcarlos commented 7 months ago

As of version v2.7.23, insertion into CLOB fields is no longer working, I had to go back to version v2.7.22 to make the insertions, it does the normal insertion but it does not insert the content, the field remains empty in the table .

Example:

_, err = db.Exec("INSERT INTO table_test(file) values (:1)", go_ora.Clob{String: "XXXXXXXXXXXXX"})

sijms commented 7 months ago

I am working on testing all previous issues and fixing all regressions

sijms commented 7 months ago

you should pass Valid: true to identify that value is not null

_, err = db.Exec("INSERT INTO table_test(file) values (:1)", go_ora.Clob{String: "XXXXXXXXXXXXX", Valid: true})
fitlcarlos commented 7 months ago

you should pass Valid: true to identify that value is not null

_, err = db.Exec("INSERT INTO table_test(file) values (:1)", go_ora.Clob{String: "XXXXXXXXXXXXX", Valid: true})

I need to validate whether the variable is null or not to be able to report True or False.

Is there no way for the method receiving this value to perform this validation within the lib?

This way it is transparent for whoever is implementing it.

sijms commented 7 months ago

when using Clob as input or output parameter you can test .Valid field if false means value is null. if true value is not null