Re: Formatting out blanks

From: Brian O'Gorman <bogorman_at_.wh.whoi.edu>
Date: Wed, 16 Feb 1994 21:36:01 GMT
Message-ID: <CLC6o1.CCv_at_netnews.whoi.edu>


In article <2jr2kt$5jq_at_paperboy.gsfc.nasa.gov> joefw_at_daac.gsfc.nasa.gov writes:
>Maybe I missed something in the manuals, but I can't see how to easily do the
>following:
>
>I want to create an output with a number from the database inside of a text
>string. The width of the number varies from 1 to 5 digits. My script currently looks like this:
> set space 0
> select 'ABC',item_no,'DEF' from item;
>
How about

        SELECT 'ABC'||LTRIM(TO_CHAR(item_no,'999999'),' ')||'DEF' from item;

>My goal is to have output formatted as:
> ABC123DEF
> ABC4DEF
> ABC4467DEF
>
>but instead get:
> ABC 123DEF
> ABC 4DEF
> ABC 4467DEF
>
>(assuming numformat is set to 999999).
>
>Any suggestions?
>
>Thanks.
>
>Joe Woytek
>joefw_at_daac.gsfc.nasa.gov
>Code 902.2
>NASA/GSFC
Received on Wed Feb 16 1994 - 22:36:01 CET

Original text of this message