mbleron / ExcelTable

ExcelTable is an Oracle SQL interface to read Microsoft Excel files (.xlsx, .xlsm, .xlsb, .xls, .xml), ODF spreadsheet files (.ods) and flat files as external tables
MIT License
45 stars 12 forks source link

ORA-06530: Reference to uninitialized composite Error when running sample #18

Closed habagit closed 4 years ago

habagit commented 4 years ago

when trying to run the sample select t.* from table( ExcelTable.getRows( ExcelTable.getFile('DIR_TEST','sample_3.xlsx') , 'DataSource' , ' "SRNO" number , "NAME" varchar2(10) , "VAL" number , "DT" date , "SPARE1" varchar2(6) , "SPARE2" varchar2(6)' , 'A2' ) ) t ;

I get the following error on Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

ORA-06530: Reference to uninitialized composite ORA-06512: at "CLOUD_EE.EXCELTABLE", line 4067 ORA-06512: at "CLOUD_EE.EXCELTABLEIMPL", line 140

  1. 00000 - "Reference to uninitialized composite" Cause: An object, LOB, or other composite was referenced as a left hand side without having been initialized. Action: Initialize the composite with an appropriate constructor or whole-object assignment.
mbleron commented 4 years ago

Thanks for reporting this. It looks like an Oracle bug, as the error doesn't make sense at this point of the code.

For some reasons, compiling the package body with debug info seems to solve the issue. So, as an immediate workaround, I suggest running the following : alter package exceltable compile debug body;

I'll probably file a SR if I manage to reproduce the problem on a small test case.

mbleron commented 4 years ago

This works too : alter package exceltable compile body plsql_optimize_level=2;

so definitely a compiler bug.

mbleron commented 4 years ago

I've rearranged the code in ExcelTable v5.0, the issue is no longer present.