Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
set echo off
accept x prompt "Enter the table to ASCII: "
accept ownr prompt "Which schema owns table '&x'?: "
accept y prompt "Enter the flat file to write: "
accept delim prompt "Enter the symbol to use as the delimiter in the text file: "
set verify off
set feedback off
set heading off
set pagesize 0
set linesize 32767
set trimout on
set trimspool on
var sq char
exec :sq := ''''
var dq char
exec :dq := '"'
prompt
prompt Following output is generated script that writes text output from table "&x"
prompt
spool temp.sql
prompt set echo off
prompt set feedback off
prompt set heading off
prompt set pagesize 0
prompt spool &y
prompt Select
select decode (rownum
,1,:sq||:dq||:sq||'||'
,'||'||:sq||'&delim'||:dq||:sq||'||')
|| column_name || '|| ''"'''
from all_tab_columns
where table_name = upper('&x') and owner = upper('&ownr');
prompt from &x
prompt /
prompt spool off
prompt set feedback on
prompt set heading on
prompt set pagesize 20
spool off
prompt
prompt Following is text output written to file "&y"
prompt
@temp
set echo off
prompt
prompt Output file = "&y"
prompt
17:26:25 WM-HUNTDL/dhunt:DHUNT SQL> @GenASCIIAnyDelimiter
Enter the table to ASCII: s_region
Which schema owns table 's_region'?: summit
Enter the flat file to write: region.txt
Enter the symbol to use as the delimiter in the text file: |
Following output is generated script that writes text output from table "s_region"
set echo off
set feedback off
set heading off
set pagesize 0
spool region.txt
Select
'"'||ID|| '"'
||'|"'||NAME|| '"'
from s_region
/
spool off
set feedback on
set heading on
set pagesize 20
Following is text output written to file "region.txt"
"1"|"North America"
"2"|"South America"
"3"|"Africa / Middle East"
"4"|"Asia"
"5"|"Europe"
Output file = "region.txt"