Re: How to add a new line inside the columns

From: Will <wkooiman_at_earthlink.net>
Date: 1 Aug 2001 00:40:11 -0700
Message-ID: <7256fcf8.0107312340.6e00cd6e_at_posting.google.com>


chisuen_at_hotmail.com (chisuen) wrote in message news:<fbed5686.0107311624.5a7f28ad_at_posting.google.com>...
> In one column, I want to insert a new line to it, how would I do it?
>
> Ex:
> Table
> Column1 (ID) Column2 (Name)
> ------------ ---------------
> 001 First Last
>
> How do I change it to
>
> Column1 (ID) Column2 (Name)
> ------------ ---------------
> 001 First
> Last

Here's an idea...

     column column2 format a15 word_wrap

     select column1, rpad(substr(column2,1,instr(column2,' ')),15) ||
                     substr(column2,instr(column2,' ')+1,50)
     from   your-table;

I probably have the syntax wrong, but I'm trying to...

  1. Define a column with word_wrap
  2. Replace the space between the first and last name with enough spaces to make the first_name be 15 bytes long. You may have to mess with the instr to handle the case where there is no space found.

Anyway, I'm sure something like that will work. Received on Wed Aug 01 2001 - 09:40:11 CEST

Original text of this message