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

Home -> Community -> Usenet -> c.d.o.server -> Re: SQLPlus formatting question

Re: SQLPlus formatting question

From: Holger Baer <holger.baer_at_science-computing.de>
Date: Wed, 16 Apr 2003 09:20:19 +0200
Message-ID: <3E9D0433.3000400@science-computing.de>


Ed Stevens wrote:
> Platform: Oracle 8.1.7
>
> I have a query that typically returns less than 5 rows. I'd like to
> force a line break after every column, so that the data is listed like
> this:
>
> Col1: value
> Col2: value
> etc.
>
> so put together a query like this:
>
> set echo off
> set heading off
>
> column empno newline
> column lastname newline
> column firstname newline
>
> select
> 'empno: ' || empno,
> 'lastname: ' || lastname,
> 'firstname: ' || firstname,
> etc.
>
> but I find that I get a line feed after some columns, and not after
> others. Is there some other mechanism at work here that I'm
> overlooking -- something else that effects line wrapping? Linewidth
> is at its default value.

Tom Kyte has a nice skript called print_table

http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:1035431863958

which does what you want.

HTH Holger Received on Wed Apr 16 2003 - 02:20:19 CDT

Original text of this message

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