I’m writing pl/sql procedure that exports data from Oracle to Excel. I need data formatting so I can’t use CSV. I’ve already tried with XML but it generates too large files
Your problem seems similar to a thread here in SO (Writing in ExcelSheet using UTL_FILE package in Oracle.) and I was able to find a simple solution to this problem recently.
i used a package called as_xlsx created by Anton Scheffer, (Create an Excel-file with PL/SQL) and did a few modifications so it creates multiple sheets inside a single Excel Workbook by putting it through a Loop.
It also supports some basic formatting such as Cell Color, Font Style, Font Size, Borders, etc. Its pretty nifty.
(Create an Excel File (.xlsx) using PL/SQL).
Hope this helps!