visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Databases :: Oracle :: oracle problem with TO_NUMBER


By: Nono Great Britain  Date: 10/04/2008 09:27:08  English French  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 French English  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

EContact
browser fav
page generated in 300.223830 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page