🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.databases.oracle.tools
4 messages
4 total messages Started by Marcos Leija Mon, 01 May 2000 00:00
to_char(123, '999999') problem
#3
Author: Marcos Leija
Date: Mon, 01 May 2000 00:00
12 lines
1143 bytes
How do I get rid of the leading space that to_char() creates when I set
it up like this:
to_char(123, '999999')
returns ' 123'


In actuality, I need to_char() to do this:
to_char(123, '099999')
...but it does the same thing.

Is this a bug or is this some setting I left out?
Marcos
Re: to_char(123, '999999') problem
#4
Author: Mike Morgan
Date: Tue, 02 May 2000 00:00
22 lines
1509 bytes
When a number is converted to text, a leading space is left in case the
number is negative (eg:  to_char(-123,'99999')).  If you don't want a
leading space, you'll have to ltrim(to_char(123, '999999')).

Mike
================================

Marcos Leija <marcos.leija@cas-mddc.com> wrote in message
news:390E051A.6CF86E98@cas-mddc.com...
> How do I get rid of the leading space that to_char() creates when I set
> it up like this:
> to_char(123, '999999')
> returns ' 123'
>
>
> In actuality, I need to_char() to do this:
> to_char(123, '099999')
> ...but it does the same thing.
>
> Is this a bug or is this some setting I left out?
> Marcos
>
Re: to_char(123, '999999') problem
#5
Author: Martin Dobler
Date: Tue, 02 May 2000 00:00
21 lines
1296 bytes
You can insert the FM element in the the format string.

e.g. to_char(123, 'FM999999')

this returns a value without leading or trailing blanks.

Martin

Marcos Leija wrote:
> 
> How do I get rid of the leading space that to_char() creates when I set
> it up like this:
> to_char(123, '999999')
> returns ' 123'
> 
> In actuality, I need to_char() to do this:
> to_char(123, '099999')
> ...but it does the same thing.
> 
> Is this a bug or is this some setting I left out?
> Marcos
Re: to_char(123, '999999') problem
#6
Author: Connor McDonald
Date: Tue, 02 May 2000 00:00
34 lines
1653 bytes
Mike Morgan wrote:
> 
> When a number is converted to text, a leading space is left in case the
> number is negative (eg:  to_char(-123,'99999')).  If you don't want a
> leading space, you'll have to ltrim(to_char(123, '999999')).
> 
> Mike
> ================================
> 
> Marcos Leija <marcos.leija@cas-mddc.com> wrote in message
> news:390E051A.6CF86E98@cas-mddc.com...
> > How do I get rid of the leading space that to_char() creates when I set
> > it up like this:
> > to_char(123, '999999')
> > returns ' 123'
> >
> >
> > In actuality, I need to_char() to do this:
> > to_char(123, '099999')
> > ...but it does the same thing.
> >
> > Is this a bug or is this some setting I left out?
> > Marcos
> >

Or use the FM format mask.

HTH
-- 
===========================================
Connor McDonald
http://www.oracledba.co.uk

We are born naked, wet and hungry...then things get worse
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads