I am tring to load a .xlsx file into an Oracle database table. I am getting an error for my code. I normally use this code for .csv files but need to use it for .xlsx I have edi
You might want to take a look at ExcelTable SQL interface (Disclaimer : I'm the author).
It provides access to .xlsx (or .xlsm) files as an external table.
Here's an example based on your ext table definition :
SELECT t.*
FROM TABLE(
ExcelTable.getRows(
ExcelTable.getFile('SEPA_FILES','Data_File.xlsx')
, 'Sheet_name_goes_here'
, ' "UNIQUE_ID" for ordinality
, "NAME" varchar2(255)
, "ALT_NAME" varchar2(255) '
, 'A2'
)
) t ;
(I assumed UNIQUE_ID is some kind of autogenerated sequence)