CREATE DIRECTORY EXPORT_DIR AS C:\path\to\export_dir; GRANT WRITE ON DIRECTORY SYS.EXPORT_DIR TO your_user; BEGIN ORA_EXCEL.new_document; ORA_EXCEL.add_sheet('Employees'); ORA_EXCEL.query_to_sheet('select * from employees'); ORA_EXCEL.save_to_file('EXPORT_DIR', 'example.xlsx'); END;