467,910 Members | 1,644 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,910 developers. It's quick & easy.

Help Needed in formatting output data !!

Can anyone of you let me knw how to obtain the output flat file in the below format ?

"ID"|"NAME"|"PARENT_ID"
"NQ TEL"|"14"|"Macetown"

But I am gettin the output.. as below.

VENDOR_NAME||'|'||VENDOR_ID||'|'||CITY
----------------------------------------------------------------------------------------------------
NQ TEL|14|Macetown
NA TEL|14|Molokai


I am using the followin script :
set heading on
set echo off
set feedback off
spool Y:\Spool\output1.txt

select Vendor_Name || '|' || Vendor_ID || '|' || City from vendor where city like 'Mo%';

spool off;
set feedback on
set echo on
set heading on



Can anyone help me on this.? In Addition to this, I also need to remove the line separating Header and the Data .
Thanks a ton. :)
Oct 16 '07 #1
  • viewed: 940
Share:
1 Reply
amitpatel66
Expert 2GB
Can anyone of you let me knw how to obtain the output flat file in the below format ?

"ID"|"NAME"|"PARENT_ID"
"NQ TEL"|"14"|"Macetown"

But I am gettin the output.. as below.

VENDOR_NAME||'|'||VENDOR_ID||'|'||CITY
----------------------------------------------------------------------------------------------------
NQ TEL|14|Macetown
NA TEL|14|Molokai


I am using the followin script :
set heading on
set echo off
set feedback off
spool Y:\Spool\output1.txt

select Vendor_Name || '|' || Vendor_ID || '|' || City from vendor where city like 'Mo%';

spool off;
set feedback on
set echo on
set heading on



Can anyone help me on this.? In Addition to this, I also need to remove the line separating Header and the Data .
Thanks a ton. :)
Place the below code in a sql file and execute:

Expand|Select|Wrap|Line Numbers
  1.  
  2. SET ECHO OFF
  3. SET FEEDBACK OFF
  4. SET TERMOUT OFF
  5. SET VERIFY OFF
  6. SET HEADING OFF
  7.  
  8. SPOOL c:\a.txt
  9.  
  10. ttitle '"ID"|"NAME"|"PARENT_ID"' LEFT
  11. select  CHR(34)||Vendor_Name||CHR(34)|| '|' ||CHR(34)||Vendor_ID||CHR(34)|| '|' ||CHR(34)||City||CHR(34) from  vendor where city like 'Mo%';
  12.  
  13. SPOOL OFF
  14.  
  15.  
Oct 16 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by BBFrost | last post: by
2 posts views Thread by mike | last post: by
2 posts views Thread by rookiejavadude | last post: by
5 posts views Thread by Icarus - iD_Ten_T helper | last post: by
1 post views Thread by mik357 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.