Hello,
I came across this error when dumping data from Oracle using a python macro:
Here is the code:
def checkDB():
context()
connection = cx_Oracle.connect(user='????',password='?????',dsn='?????')
cursor = connection.cursor()
sql = wb.Sheets['sql'].getCellRangeByName("a1").String
result= cursor.execute(sql).fetchall()
active_sheet.getCellRangeByName('A1:BK1048576').clearContents(7)
oRangeSource = active_sheet.getCellRangeByName('A1:BK'+str(cursor.rowcount)).setDataArray(result)
return None
And there is the error:
com.sun.star.uno.RuntimeException: [mscx_uno bridge error] UNO type of C++ exception unknown: "std.bad_alloc", RTTI-name=".?AVbad_alloc@std@@"! (Error during invoking function checkDB in module file:///D:/Program%20Files/LibreOffice/Data/settings/user/Scripts/python/Hello.py (<class 'uno.com.sun.star.uno.RuntimeException'>: [mscx_uno bridge error] UNO type of C++ exception unknown: "std.bad_alloc", RTTI-name=".?AVbad_alloc@std@@"!
File "D:\Program Files\LibreOffice\App\libreoffice\program\pythonscript.py", line 915, in invoke
ret = self.func( *args )
File "D:\Program Files\LibreOffice\Data\settings\user\Scripts\python\Hello.py", line 111, in checkDB
oRangeSource = active_sheet.getCellRangeByName('A1:BK'+str(cursor.rowcount)).setDataArray(result)
))
edit by @karolus : fenced Code and Error-msg with backtics``````
The sql was very complex. The first error I got was that it could not process the Oracle date timestamp properly. I converted that to varchar using to_char. Now i am stuck at the above error. This does not seem to handle large number of rows very well. Is there is a workaround? Thank you.