SQL> @GenASCII
Enter the Oracle username that owns the source table: test
Enter the table to ASCII: s_dept
Enter the flat file to write: dept.txt
Following output is generated script that writes text output from table "s_dept"
set echo off
set feedback off
set heading off
set pagesize 0
spool dept.txt
Select
'"'||ID|| '"'
||',"'||NAME|| '"'
||',"'||REGION_ID|| '"'
from test.s_dept
/
spool off
set feedback on
set heading on
set pagesize 20
Following is text output written to file "dept.txt"
"10","Finance","1"
"31","Sales","1"
"32","Sales","2"
"33","Sales","3"
"34","Sales","4"
"35","Sales","5"
"41","Operations","1"
"42","Operations","2"
"43","Operations","3"
"44","Operations","4"
"45","Operations","5"
"50","Administration","1"
"99","Extra","1"
Output file = "dept.txt"