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

PLS-00307: too many declarations of 'ODCITABLEDESCRIBE' match this call altough cursor_sharing set to exact #36

Closed adrianboangiu closed 2 years ago

adrianboangiu commented 2 years ago

Hello Marc,

I am using Oracle 19 and the cursor_sharing parameter is set to exact. I am trying to use ExcelTable.getRows and to specify the sheet using a function in a package. I obtain the folowing error:

ORA-06550: line 4, column 13:
PLS-00307: too many declarations of 'ODCITABLEDESCRIBE' match this call
ORA-06550: line 4, column 6:
PL/SQL: Statement ignored
06550. 00000 -  "line %s, column %s:\n%s"
*Cause:    Usually a PL/SQL compilation error.
*Action:

If I use a hardcoded value everything works. Best regards

mbleron commented 2 years ago

I'm afraid it's a limitation of ODCI that cannot be overcome. ODCITABLEDESCRIBE is called by Oracle when it first parses the query. During that step, all non-literals (except simple expressions made of literals) values are passed as NULL, that's why it cannot tell which overload to call.

The workaround is to use getCursor function instead, or use dynamic SQL.