Inserting Decimal/Float Data Using the Array Interface and Binding the Type as ORATYPE_NUMBER Using a Comma as the Decimal Separator will Result in Either Data Corruption or Invalid Number (Doc ID 780644.1)

Last updated on SEPTEMBER 17, 2010

Applies to:

Oracle Objects for OLE - Version: 9.2.0.1 to 11.1.0.6.2 - Release: 9.2 to
Microsoft Windows (32-bit)
Microsoft Windows Server 2003

Symptoms

Inserting decimal/float data using the array interface binding the type as ORATYPE_NUMBER and setting the regional settings so that a comma is used as the decimal separator will result in either Data Corruption or Invalid Number. Data corruption will occur in 10gr2 and inavlid number will be reported in 11g.

The following simple testcase reproduces the bug when the regional settings are French Canadian.

create table testfloat (pk number, float1 float);

Set OO4OSession = CreateObject("OracleInProcServer.XOraSession")
Set OraDb = OO4OSession.OpenDatabase("V102", "scott/tiger", 0)
OraDb.Parameters.AddTable "PK", ORAPARM_INPUT, ORATYPE_NUMBER, 2, 22
OraDb.Parameters.AddTable "FLOAT1", ORAPARM_INPUT, ORATYPE_NUMBER, 2, 22
Set PkArray = OraDb.Parameters("PK")
Set Float1Array = OraDb.Parameters("FLOAT1")
PkArray(0) = 3
PkArray(1) = 4
Float1Array(0) = 0.992
Float1Array(1) = 0.552
OraDb.ExecuteSQL "INSERT INTO TESTFLOAT VALUES(:PK,:FLOAT1)"

SQL> select * from testfloat;

PK FLOAT1
---------- ----------
3 0
4 0

SQL>

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms