I have requirement to run custom oracle sql script and save output as csv/excel to windows directory where we have pl/sql is installed .
script has around 30 columns .for sample below query can be used
SELECT emp_idno,emp_fname,emp_lname,emp_dept FROM emp_details
sample data
emp_idno emp_fname emp_lname emp_dept
839139 Maria Foster 57
127323 Michale Robbin 57
843795 Enric Dosio 57
847674 Kuleswar Sitaraman 57
555935 Alex Manuel 57
the output of the file should be saved to windows D:/Output/file.xlsx
Is there a way I can make this exportable into a CSV or Excel format from pl/sql block? or can we have some kind of automated in pl/sql to do this ? Can anyone provide me with some guidance here? Thanks!