Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: ora-01722 invalid number
"Christian" <luetke.entrup_at_gmx.de> wrote in message
news:bifeqr$uv3$07$1_at_news.t-online.com...
> Hello everybody,
>
> hope anybody can help me.
>
> I got the this invalid number exception when I tried to store a
> floating-point number with a comma as decimal separator
> in my Java-App.
> My customer wishes to use German numeric character settings, which is a
> comma as decimal separator and '.' for the thousands.
> I know that I can chance the NLS_NUMERIC_CHARACTERS setting, but if I set
> it to '.,', which is exactly what I need,
> I can store the number with a comma, but when I retrieve the same number
> back from the DB, it is shown with a '.' instead of the comma,
> and the next try to store this number back fails with the exception above.
>
> example:
> a java textfield with the value '9,23' is saved in the Oracle-DB
correctly.
> retrieving this value back into the same textfield appears as '9.23'
> saving again fails with ORA-01722 until I change the '.' back to comma.
>
> I'm using Oracle 9.2.0.1.0
> NLS_LANG-settings : GERMAN_GERMANY.WE8ISO8859P1
> additional settings: NLS_DATE_FORMAT='DD.MM.YYYY'";
> NLS_NUMERIC_CHARACTERS='.,'";
>
> it seems to be strange that the NLS-setting for germany is not sufficient
> for my purposes, because
> it's only the common german numeric setting I have to use. Maybe a bug in
> the Oracle-NLS??
>
> thanks in advance
> Chris
>
>
Evidently not a bug of course, but you just get when you ask it do , as you probably aren't using the to_number function with the appropiate format, which would call on using the D(ecimal) and the G(roup) separator, instead of using hardcoded comma's and dots.
-- Sybrand Bakker Senior Oracle DBA to reply remove '-verwijderdit' from my e-mail addressReceived on Tue Aug 26 2003 - 06:13:18 CDT
![]() |
![]() |