Databases :: Oracle :: oracle problem with TO_NUMBER |
|||
| By: Nono |
Date: 10/04/2008 09:27:08 |
Points: 20 | Status: Answered Quality : Excellent |
|
I'm trying basic string-to-number conversion in Oracle and I've problems : SQL> select to_number('1,4','999999,9') from dual; select to_number('1,4','999999,9') from dual * ERREUR à la ligne 1 : ORA-01722: Nombre non valide SQL> select to_number('1,4','9G9') from dual; select to_number('1,4','9G9') from dual * ERREUR à la ligne 1 : ORA-01722: Nombre non valide If using the other decimal separator with the correct number of decimals : SQL> select to_number('1.4','999999D9') from dual; TO_NUMBER('1.4','999999D9') --------------------------- 14 The result should be 1.4 !!! How come Oracle can't understand something as basic as this ? |
|||
| By: VGR | Date: 10/04/2008 10:07:04 | Type : Answer |
|
| the solution : SQL> select to_number('1,4','999999D9') from dual; TO_NUMBER('1,4','999999D9') --------------------------- 1,4 mauvais séparateur décimal ; cf NLS_NUMERIC_CHARACTERS Donc oracle = caca, dangereux |
|||
|
Do register to be able to answer |
|||
| Add This Article To: | |||
| |
|
|
|
| |
|
|
|









