Help Needed in formatting output data !!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fibreclaw
    New Member
    • Oct 2007
    • 2

    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"|"PA RENT_ID"
    "NQ TEL"|"14"|"Mace town"

    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\output 1.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. :)
  • amitpatel66
    Recognized Expert Top Contributor
    • Mar 2007
    • 2358

    #2
    Originally posted by fibreclaw
    Can anyone of you let me knw how to obtain the output flat file in the below format ?

    "ID"|"NAME"|"PA RENT_ID"
    "NQ TEL"|"14"|"Mace town"

    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\output 1.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:

    [code=oracle]

    SET ECHO OFF
    SET FEEDBACK OFF
    SET TERMOUT OFF
    SET VERIFY OFF
    SET HEADING OFF

    SPOOL c:\a.txt

    ttitle '"ID"|"NAME"|"P ARENT_ID"' LEFT
    select CHR(34)||Vendor _Name||CHR(34)| | '|' ||CHR(34)||Vend or_ID||CHR(34)| | '|' ||CHR(34)||City ||CHR(34) from vendor where city like 'Mo%';

    SPOOL OFF

    [/code]

    Comment

    Working...