Closed Miqy closed 3 months ago
Your testcase runs fine with 23ai Oracle Client & Database.
In the old days, I used to recommend not using BOOLEAN in language drivers until Oracle Database 12.2. I recall Oracle bug 21660729 which was fixed in 12.2 (and doesn't look like it was backported to 12.1). That bug was really about interop between big & little endian client & server. But there may have been other issues.
As Chris mentioned, this is a known mismatch between the Oracle Client libraries and the database which is not going to be repaired at this stage! You can do this until you are able to upgrade your database:
var = cursor.var(int)
cursor.execute("""
begin
:1 := test_bool_insert(:2 = 1);
end;""",
[var, 1])
result = var.getvalue()
If you have a variable that contains a boolean you can use int(value)
to convert it to an integer for passing to the database.
You could also try thin mode. I don't recall whether thin mode supports this correctly or not. Since it never worked in thick mode I don't know whether we tried it or not and I don't have ready access to such an old database. Upgrade when you can!
Thank you for your code. It works, but I resolved the issue by replacing the boolean function parameter with an integer parameter (0 and 1).
Yep. That works, too. :-)
oracledb==2.2.1 Oracle database server 12.1 Oracle instant client 21.1.0.0
I have python code:
In the Oracle database i have function
Then i got stacktrace:
Any suggestions?