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
I'm currently working on a project where I need to convert boolean values to varchar2(1) in Oracle. These values should be represented as "J" for true (similar to "yes") and "N" for false (akin to "no").
For this task, I'm using the go-ora/v2 v2.7.11 library. In my code, I have defined a type called OracleBool, which is essentially a boolean with a custom Valuer interface:
Now, the challenge arises when I try to execute the insert operation using the defined OracleBool type:
funcInsert(...) {
varbOracleBool=trueresult, err:=t.tx.ExecContext(ctx, `INSERT INTO sometable (bool_col) VALUES (:myBool)`, b)
}
However, I'm encountering an issue with the error message: strconv.ParseFloat: parsing "n": invalid syntax.
After some investigation, I suspect that this error might be related to the type detection in the library's code, particularly this section (you can find it here):
I'm reaching out for assistance in resolving this hiccup. Any insights or guidance would be highly appreciated.
Thanks for your awesome work!
Best regards,
Andy
The text was updated successfully, but these errors were encountered:
schackoa
changed the title
Issue with Converting Booleans to varchar2(1) with Valuer Interface Oracle using go-ora/v2 v2.7.11
Issue with Converting Booleans to varchar2(1) Oracle with Valuer Interface using go-ora/v2 v2.7.11
Aug 4, 2023
I do change in the above code replacing input.Kind() == reflect.Bool when I add new type PLSQL Boolean
I will also test you code before make the release
Hey there,
I'm currently working on a project where I need to convert boolean values to varchar2(1) in Oracle. These values should be represented as "J" for true (similar to "yes") and "N" for false (akin to "no").
For this task, I'm using the go-ora/v2 v2.7.11 library. In my code, I have defined a type called OracleBool, which is essentially a boolean with a custom Valuer interface:
Now, the challenge arises when I try to execute the insert operation using the defined OracleBool type:
However, I'm encountering an issue with the error message:
strconv.ParseFloat: parsing "n": invalid syntax
.After some investigation, I suspect that this error might be related to the type detection in the library's code, particularly this section (you can find it here):
I think this could be the reason (https://github.com/sijms/go-ora/blob/master/v2/parameter_encode.go#L264C2-L264C45)
I'm reaching out for assistance in resolving this hiccup. Any insights or guidance would be highly appreciated.
Thanks for your awesome work!
Best regards,
Andy
The text was updated successfully, but these errors were encountered: