Open
Description
Isn't the following code the opposite of what is in the if and else blocks?
python-oracledb/samples/json_direct.py
Lines 68 to 74 in 2325059
So, I think the below code is preferred:
if connection.thin or client_version >= 21:
# Thin mode
cursor.execute(inssql, [1, json.dumps(data)])
else:
# Thick mode
cursor.setinputsizes(None, oracledb.DB_TYPE_JSON)
cursor.execute(inssql, [1, data])
In my environment, softwares' version are:
- Oracle Database Server: Oracle Database 23ai,
- Database Client: instantclient-basic-linux.x64-23.4.0.24.05.zip ,
- Python: Python 3.12.4, python-oracledb==2.2.1.
If I use direct binding in Thin mode, clients can't display rows including a JSON column, or the column's value shows "java.lang.UnsupportedOperationException".