Oracle Loader for .xlsx file

后端 未结 2 797
长发绾君心
长发绾君心 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条回答
  •  猫巷女王i
    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)

提交回复
热议问题