A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/oracle/python-cx_Oracle/issues/181 below:

strange issue with boolean values being coerced to integer or not based on version of instantclient in use · Issue #181 · oracle/python-cx_Oracle · GitHub

So I'm not sure how the presence of "instantclient" affects how cx_Oracle 6.x works , since I use Oracle 6.x here without any kind of separate client library. Have a user who gets the error with this script (and I do not). I would gather that using setinputsizes() would fix, however we're trying to avoid having to use that these days:

import cx_Oracle

c = cx_Oracle.connect(
    dsn=cx_Oracle.makedsn("oracle1120", 1521), user="scott", password="tiger")

cursor = c.cursor()

try:
    cursor.execute("drop table foo")
except:
    pass

cursor.execute("""
    create table foo(
        id integer primary key,
        data SMALLINT
    )
""")

cursor.execute("INSERT INTO foo (id, data) VALUES (:id, :data)", {"id": 1, "data": True})
cursor.execute("UPDATE foo SET data=:data", {"data": False})

I don't use instantclient, so it passes for me, sending True/False constants for the integer value without calling setinputsizes(). However per the user, with oracle instantclient 12.2.0.1.0 they get this trace:


Traceback (most recent call last):
  File "test_michael2.py", line 20, in <module>
    cursor.execute("INSERT INTO foo (id, data) VALUES (:id, :data)", {"id": 1, "data": True})
cx_Oracle.DatabaseError: ORA-03115: unsupported network datatype or representation

with oracle instantclient 11.2, there's no error.

Need to understand what's going on here, and how exactly True/False, which are themselves integers, are not going in correctly (what could they be going in as?)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4