Using DB_TYPE_BOOLEAN in SQL on Oracle 23c. · Issue #263 · oracle/python-oracledb (original) (raw)

Docs state that DB_TYPE_BOOLEAN can be used only within PL/SQL, however it should be possible to use in SQL since Oracle 23c.

  1. What versions are you using?

Oracle 23c

platform.platform: Linux-5.15.0-89-generic-x86_64-with-glibc2.35
sys.maxsize > 2**32: True
platform.python_version: 3.10.9
oracledb.__version__: 1.4.2
  1. Is it an error or a hang or a crash?

Error

  1. What error(s) or behavior you are seeing?

The following query raises ORA-00920: invalid relational operator

SELECT NOT :arg0 FROM "SOME_TABLE"

when :arg0 is a parameter with input_size = Database.DB_TYPE_BOOLEAN, it seems that is converted to the NUMBER.

  1. Does your application call init_oracle_client()?

No.

  1. Include a runnable Python script that shows the problem.

I can debug my issue and provide details about why and where oracledb is at fault, but first I wanted to confirm that DB_TYPE_BOOLEAN can be used within SQL and it's not something that you work on. Thanks.