-
Error in To_char
Hi All,
Iam executing the below statement with value as two digit number.
Select to_number(to_char('10','99999999,99')) from dual ;
Iam getting the output as 10
when run for 3 digit number iam getting Invalid number.
Select to_number(to_char('125','99999999,99')) from dual ;
Like to kknow what makes this happen or how to rectify it.
Thanks!
Tarus
-
Did you set group and decimal characters?
Did you set NLS_NUMERIC_CHARACTERS = ",."?
Code:
SQL> alter session set NLS_NUMERIC_CHARACTERS = ",.";
Session altered.
SQL> select to_char(10,'999G999D99') from dual;
TO_CHAR(10
----------
10,00
1 row selected.
SQL> select to_char(125,'999G999D99') from dual;
TO_CHAR(125
-----------
125,00
1 row selected.
SQL> select to_char(12345,'999G999D99') from dual;
TO_CHAR(123
-----------
12.345,00
1 row selected.
SQL>
"The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|