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: Ronald <devnull_at_ronr.nl>
Date: 16 Apr 2003 03:30:23 -0700
Message-ID: <67ce88e7.0304160230.50319624@posting.google.com>


Ed Stevens <nospam_at_noway.nohow> wrote in message news:<fqvo9vo8juojfo545793cf7sbig7aaktac_at_4ax.com>...
> 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.

Ed,

you forgot the column alias.
select

       'empno: '    ||   empno empno,
       'lastname: ' ||  lastname lastname,
       'firstname: ' ||  firstname firstname,
etc.

should work.

Ronald.



http://ronr.nl/unix-dba Received on Wed Apr 16 2003 - 05:30:23 CDT

Original text of this message

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