I am using one query as below. I want to export result set of below query into csv file.
select a.eid, b.ename, c.pid, b.pnm
from tab1 a join tab2 b on a.eid=b.eid
join tab3 c on b.pid=c.pid;
I want to extract csv file from the above result set along with headers & save into C:\User\mows\ folder using Stored procedure or any script. So I need result set with header in csv like below format. Could you please help me on this.
EID ENAME PID PNM
--- ----- --- ---
1001 Steve 21 IT
1003 Tim 23 Management
1005 Craig 25 Account
.......................
Data along with headers in csv file when above SQL query run.
CREATE TABLEstatement for your tables; theINSERTstatement for some sample data; the expected output for that sample data; YOUR attempt at a solution; details of the application you are using to connect to the database (do you want a pure PL/SQL solution or an SQL/Plus script toSPOOLthe output or a SQL Developer solution or something else?)spoolwhich is not working here each table having many columns but i have to select just few columns in aboveSQLquery.ToadI am using