Hi,
DB: Oracle Database 12c EE Extreme Perf Release 12.1.0.2.0 - 64bit Production
Client: oracledb.version: 1.2.2
DatabaseError
We are currently facing an issue where certain query strings that use to work with cx_Oracle
are throwing either ORA-03120 or ORA-03146 errors. The same query using DBeaver client works so the issue is likely with oracledb
.
Our code goes like:
conn = oracledb.connect(
user=user,
password=pw,
host=host,
port=port,
service_name=service_name
)
sql = """
SELECT *
FROM TABLE
WHERE FIELD = 'カタカナ'
"""
with conn.cursor() as cur:
cur.execute(sql)
rows = cur.fetchall()
Which results in DatabaseError: ORA-03146: Invalid buffer length for TTC field
If we added a limit on the results, a different DatabaseError
is thrown
sql = """
SELECT *
FROM TABLE
WHERE FIELD = 'カタカナ'
FETCH FIRST 10 ROWS ONLY
"""
This will result in ORA-03120: two-task conversion routine: integer overflow
After trial and error, we found that using bind variable helps to get us past this issue:
sql = """
SELECT *
FROM TABLE
WHERE FIELD = :katakana
"""
with conn.cursor() as cur:
cur.execute(sql, katakana='カタカナ')
rows = cur.fetchall()
No, we use the thin client. But the same queries work with cx_Oracle and DBeaver client.
See above.
Thanks!
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