Problems with TOraLoader and floating point values if using Oracle (german locale settings); ORA-01722: invalid number

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ac
Posts: 32
Joined: Mon 16 Jan 2006 12:56

Problems with TOraLoader and floating point values if using Oracle (german locale settings); ORA-01722: invalid number

Post by ac » Mon 22 May 2006 09:47

Oracle 9.2.0.7 (german)
Delphi 7

When trying to insert rows of type NUMBER/FLOAT into a table using TOraLoader, an exception "ORA-01722" occurs.
I think I found the reason: If Oracle uses english locale settings (decimal separator = . (dot)) then it works. In our case the locale settings for Oracle are german (decimal separator = , (comma)).

The problem, I think, is that TOraLoader.PutColumnData _always_ uses . (dot) as decimal separator:

TOraLoader.PutColumnData, lines 487-494:

Code: Select all

            varDouble,varSingle,varCurrency: begin
              OldDecimalSeparator := DecimalSeparator;
              DecimalSeparator := '.';
              Str := FloatToStr(Value);
              DecimalSeparator := OldDecimalSeparator[1];
If I remove the decimal-separator code like this:

Code: Select all

            varDouble,varSingle,varCurrency: begin
              Str := FloatToStr(Value);
it works fine, since my Windows locale settings correspond to the locale settings of Oracle.

Of course this is not the fix, since Oracle can have different locale settings than the OS.

Wouldn't be the best solution to get the Oracle locale settings and use them for the conversion? If so, can you please tell me if this will be fixed for the next release?

If you will not fix this, can you show me a workaround?

thanks,
Alexander

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Wed 24 May 2006 13:39

We have fixed this problem. The fix will be included in next build of ODAC.

ac
Posts: 32
Joined: Mon 16 Jan 2006 12:56

Post by ac » Thu 08 Jun 2006 11:16

Now I get an even worst error: ORA-03113: end-of-file on communication channel.
We use the german Oracle 9.2.0.7.

TestOnGetColumnData: EOraError
at ..\Source\OraCall.pas:3896 OraError$437C2A55
ORA-03113: Unerwartetes Übertragungsende in Kommunikation
StackTrace
[437C2A50]{pODAC0450.bpl} OraCall.OraError (Line 3896, "..\Source\OraCall.pas")
[437C2DEC]{pODAC0450.bpl} OraCall.Check (Line 3969, "..\Source\OraCall.pas")
[43823333]{pODAC0450.bpl} OraLoader.TOraLoader.Finish (Line 417, "..\Source\OraLoader.pas")
[437FE323]{pODAC0450.bpl} DALoader.TDALoader.Load (Line 304, "..\Source\DALoader.pas")

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 08 Jun 2006 13:25

We cannot reproduce the problem. If it is possible send to ODAC support address complete sample that demonstrates the problem and include script to create server objects.

Post Reply