niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » Oracle
to_char (33, '0009') adds an extra white space
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
Author Message
Günther De Vogelaere
*nix forums beginner


Joined: 09 Jan 2006
Posts: 2

PostPosted: Mon Jan 09, 2006 1:03 pm    Post subject: to_char (33, '0009') adds an extra white space Reply with quote

Hi,

When I execute 'select '*' || to_char(33,'0009') || '*' from dual
I get '* 0033*' instead of '*0033*'.

Does anybody know what might be wrong? Something wrong in my configuration?
Back to top
sybrandb@yahoo.com
*nix forums Guru


Joined: 30 May 2005
Posts: 482

PostPosted: Mon Jan 09, 2006 1:44 pm    Post subject: Re: to_char (33, '0009') adds an extra white space Reply with quote

Nothing wrong. Oracle adds automatically a '-' for negative numbers and
a ' ' for positive numbers.
(As documented).
If you don't want that prefix the format with 'fm', so
to_char(33,'fm0009')

--
Sybrand Bakker
Senior Oracle DBA
Back to top
Günther De Vogelaere
*nix forums beginner


Joined: 09 Jan 2006
Posts: 2

PostPosted: Mon Jan 09, 2006 2:17 pm    Post subject: Re: to_char (33, '0009') adds an extra white space Reply with quote

<sybrandb@yahoo.com> schreef in bericht
news:1136814278.434529.146080@g14g2000cwa.googlegroups.com...
Quote:
Nothing wrong. Oracle adds automatically a '-' for negative numbers and
a ' ' for positive numbers.
(As documented).
If you don't want that prefix the format with 'fm', so
to_char(33,'fm0009')

--
Sybrand Bakker
Senior Oracle DBA


Thx :)

Most examples on the web don't even mention the 'fm'.
The strangest thing is, my code (PL/SQL) previously worked flawless without
the 'fm' :s
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
The time now is Tue Jan 06, 2009 8:53 am | All times are GMT
navigation Forum index » Databases » Oracle
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts FAQ 4.32 How do I strip blank space from the beginning/en... PerlFAQ Server Perl 0 Fri Jul 21, 2006 1:03 pm
No new posts to_char number format with optional decimal-point? Martin T. Oracle 3 Thu Jul 20, 2006 10:53 am
No new posts strange user-space hangs Dan Miller system 2 Thu Jul 20, 2006 12:07 am
No new posts Unused space Hoosbruin Sybase 1 Wed Jul 19, 2006 12:46 am
No new posts how to add a space after first word ina s entence sudip05@mailcity.com Perl 2 Tue Jul 18, 2006 11:12 am

Bankruptcy | Air Jordans | Loans | Credit Counseling | Glitter Graphics
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.2549s ][ Queries: 16 (0.1785s) ][ GZIP on - Debug on ]