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)
1) Option [ Pure PL/SQL]
Xlsx document is zipped set of xml documents. You can change extension xlsx to zip, unzip and find out what is inside. Here is description how to deal with xlsx document in oracle environment. This solution works but implementation is very painful.
2) Option (PL/SQL + apache POI) Create implementation in java. And use it in db.
3) Convert xlxs to csv.