format mask [message #316817] |
Mon, 28 April 2008 07:56 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
rajesh4851
Messages: 89 Registered: January 2007
|
Member |
|
|
Hi,
How to apply the format mask to give the output like the below:
Eg: data is like 1234567890, output should be 1234.567.890.
As per American standards we can use 'NNNNGNNNGNNN'. It will give output like 1234,567,890, but i want to give the output like 1234.567.890.
Please help me to solve this problem.
Regards,
Rajesh
|
|
|
Re: format mask [message #316957 is a reply to message #316817] |
Tue, 29 April 2008 00:01 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
It is about decimal and group characters; you'll have to ask your DBA to change this setting in order to display numbers the way you'd want it to.
For a session, no problem - you can do it yourself:SQL> select to_char(1234567890, '9999G999G999') result from dual;
RESULT
-------------
1234,567,890
SQL> alter session set nls_numeric_characters = ',.';
Session altered.
SQL> select to_char(1234567890, '9999G999G999') result from dual;
RESULT
-------------
1234.567.890
Or, you might do that by using the REPLACE function (so that you wouldn't have to ALTER anything):SQL> select replace(to_char(1234567890, '9999G999G999'), ',', '.') result
2 from dual;
RESULT
-------------
1234.567.890
SQL> This, however, can not be used in Format Mask property; you'd have to do that in, for example, POST-QUERY trigger.
|
|
|
|