Re: [q]: How to format a SQL output ?

From: John Verhoeven <johnv_at_acix.DIALix.oz.au>
Date: 1996/11/07
Message-ID: <johnv.0abi_at_acix.DIALix.oz.au>#1/1


In article dated 5 Nov 1996 09:55:54 GMT, crosby (crosby_at_po.pacific.net.sg) wrote:
> Before issuing your SQL statement, enter the following line in SQL*Plus
> column name format a20
>
> Now execute the following query
>
> select name
> from emp
>
> This will ensure only the first 20 characters are displayed.

Nope sorry. This just limits the output column width to 20 characters. If the column actually has 25 characters you will get output like this:

        COLUMN
        --------------------
        this output causes t
        he result to wrap

What you need to do is
        select substr(column,1,20) from table

This will only give you the first 20 characters.

--
 _--_|\  John Verhoeven           Unix / Database Administrator Westrail
/      \              johnv_at_DIALix.oz.au / jverhoeven_at_westrail.wa.gov.au
*_.--._/
      v   "Smile! things could be worse... So I did... and they were..."
Received on Thu Nov 07 1996 - 00:00:00 CET

Original text of this message