Question: how to export data from oracle table to csv file using pl sql?
Answer: Create a Directory Object in which you will write CSV file. ... 
Create a Database Procedure in Scott schema or if you are creating in another schema then make sure you have the Emp table in that schema, else you need to change the Cursor and the field references for any other table. ... 
Now run the procedure as follows: