Oct-17-2022, 06:23 PM
Hi all, I'm running a python code that was working before with older version. Now using 3.10 I'm gettin error below:
TypeError: output_type_handler() takes 2 positional arguments but 6 were givenThe block is below:
return_code = 0
try:
with tempfile.TemporaryDirectory() as tmp_dir:
import cx_Oracle as oracledb
import xml.etree.ElementTree as ET
import os
import subprocess
def output_type_handler(
cursor,
default_type):
if default_type == oracledb.CLOB:
return cursor.var(
oracledb.LONG_STRING,
arraysize=cursor.arraysize)
if default_type == oracledb.BLOB:
return cursor.var(
oracledb.LONG_BINARY,
arraysize=cursor.arraysize)
conn = oracledb.connect("/", mode=oracledb.SYSDBA)
conn.outputtypehandler = output_type_handler
prev_name = None
cursor = conn.cursor()
cursor.execute(
"select name, cval from v$view where conftype='XYZ' order by name desc")I'm returning only 2 columns in query and declared 2 type handler columns so not sure from where it was getting "6 arguments given".
