Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Formatting SQLplus output

Re: Formatting SQLplus output

From: Nuno Guerreiro <nuno-v-guerreiro_at_telecom.pt>
Date: Tue, 21 Jul 1998 17:19:23 GMT
Message-ID: <35b4ccf8.92362480@news.telecom.pt>


On Tue, 21 Jul 1998 16:36:33 GMT, nasof_at_hotmail.com wrote:

>> How can I format sql query output so that a certain column is not printed
>> repeatedly?
>> I used Break On <column name>, but it didn't work when I concatenate my
>> column with | (pipe). I need to concatenate the columns because I want to
>> dump the output to a flat file, then email the flatfile as attachment.
>> I would appreciate any idea on how to do this.
>>
>> Eg. query:
>> Select employee# || '|' || order# || '|' || product# || '|'
>> from table1
>>
>> sample output:
>> E1 | Ord1 | Prod1
>> E1 | Ord1 | Prod2
>> E1 | Ord1 | Prod3
>>
>> desired output (same order numbers only printed once)
>> E1 | Ord1 | Prod1
>> E1 | | Prod2
>> E1 | | Prod3
>>
>> Thanks,

There is an option on the SET command which allows you to change the column separator from ' ' (space) to any character you want. Simply issue the following statement:

SET COLSEP '|' Continue using the BREAK on the column and you should get what you want.

Hope this helps,

Nuno Guerreiro Received on Tue Jul 21 1998 - 12:19:23 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US