Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQLPlus formatting question
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.
![]() |
![]() |