You can make use of UTL_FILE package for writing data to text file using PLSQL.
You can also try this:
Have a cursor that selects the data from the table in the format:
CURSOR C1 IS SELECT empno||','||ena me from emp;
LOOP through the cursor and write the data using UTL_FILE record by record.
Comment