Oracle Loader for .xlsx file

后端 未结 2 796
长发绾君心
长发绾君心 2021-01-27 05:55

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

相关标签:
2条回答
  • 2021-01-27 06:29

    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)

    0 讨论(0)
  • 2021-01-27 06:31

    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.

    0 讨论(0)
提交回复
热议问题