Thread: BUG With 10g OleDB Provider!


Permlink Replies: 10 - Pages: 1 - Last Post: Oct 10, 2006 4:33 PM Last Post By: user529309
JAMES_2JS

Posts: 3
Registered: 01/17/06
BUG With 10g OleDB Provider!
Posted: Mar 28, 2006 3:22 AM
Click to report abuse...   Click to reply to this thread Reply
Hi there!

I originally thought I was going mad, but now I think there's a bug in the 10g Oracle OleDB Provider. I can repeat this at will on my systems:

* Windows XP SP2 (with all the latest Windows Update Patches)
* Oracle Client (including OleDB Provider) v10.2.0.1.0
* MDAC 2.8 SP1 (with Windows XP SP2)

or

* Windows 2000 Workstation (with all the latest Windows Update Patches)
* Oracle Client (including OleDB Provider) v10.2.0.1.0
* MDAC 2.7

Here's all I have to do!

1) Create a table with some data in Oracle (have tested this against 8i, 9i and 10g databases):

CONN your_username/your_password@your_tns_service_name

CREATE TABLE OLEDB_TEST
(
RECORD_ID NUMBER(5) NOT NULL,
RECORD_DESC VARCHAR2(50) NOT NULL
)
/

INSERT INTO OLEDB_TEST VALUES(0 , '0 is OK!');
INSERT INTO OLEDB_TEST VALUES(1 , '1 is OK!');
INSERT INTO OLEDB_TEST VALUES(10 , '10 is wrong - comes out as 0');
INSERT INTO OLEDB_TEST VALUES(12 , '12 is OK');
INSERT INTO OLEDB_TEST VALUES(100 , '100 is wrong - comes out as 0');
INSERT INTO OLEDB_TEST VALUES(120 , '120 is wrong - comes out as 20');
INSERT INTO OLEDB_TEST VALUES(1200 , '1200 is wrong - comes out as 0');
INSERT INTO OLEDB_TEST VALUES(1230 , '1230 is wrong - comes out as 230');
INSERT INTO OLEDB_TEST VALUES(12300, '12300 is wrong - comes out as 300');
INSERT INTO OLEDB_TEST VALUES(12340, '12340 is wrong - comes out as 2340');
COMMIT;
2) Run some VBScript (which you can do in VB6, ASP or however else you want to add it in):

' Constants for the connection string
Const strUSER = "your_username" ' e.g. SCOTT
Const strPASSWORD = "your_password" ' e.g. TIGER
Const strTNS_SERVICE_NAME = "your_tns_service_name" ' e.g. ORCL

Dim objConnection
Dim objRecordset

' make sure we have a temp directory to write to, and that any existing file is deleted
On Error Resume Next
MkDir "C:\temp\"
Kill "c:\temp\oledb_test.txt"
On Error GoTo 0

' create the ADO connection
Set objConnection = CreateObject("ADODB.Connection")
' set the connection string
' Using the Microsoft OLEDB Provider for Oracle works fine and dandy!
'objConnection.ConnectionString = "Provider=MSDAORA.1;User ID=" & strUSER & ";Password=" & strPASSWORD & ";Persist Security Info=True;Data Source=" & strTNS_SERVICE_NAME
' But using Oracle Provider for OLEDB causes us problems!!
objConnection.ConnectionString = "Provider=OraOLEDB.Oracle.1;User ID=" & strUSER & ";Password=" & strPASSWORD & ";Persist Security Info=True;PLSQLRSet=1;Data Source=" & strTNS_SERVICE_NAME

' set the cursor to open on the client
objConnection.CursorLocation = 3 ' adUseClient
' open the connection
objConnection.Open

' create the ADO recordset object
Set objRecordset = CreateObject("ADODB.Recordset")
' set its active connection
Set objRecordset.ActiveConnection = objConnection
' open it up, pulling in the data from the oledb connection
objRecordset.Open "SELECT * FROM OLEDB_TEST"
' disconnect the recordset
Set objRecordset.ActiveConnection = Nothing

' persist the recordset's data to XML
objRecordset.Save "C:\temp\oledb_test.txt", 1 ' adPersistXML

' clean up our objects
objRecordset.Close
Set objRecordset = Nothing
objConnection.Close
Set objConnection = Nothing


3) The resulting file in c:\temp\oledb_test.txt is as follows:

<xml xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'
xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'
xmlns:rs='urn:schemas-microsoft-com:rowset'
xmlns:z='#RowsetSchema'>
<s:Schema id='RowsetSchema'>
<s:ElementType name='row' content='eltOnly'>
<s:AttributeType name='RECORD_ID' rs:number='1' rs:writeunknown='true'>
<s:datatype dt:type='number' rs:dbtype='numeric' dt:maxLength='19' rs:scale='0' rs:precision='5' rs:fixedlength='true'
rs:maybenull='false'/>
</s:AttributeType>
<s:AttributeType name='RECORD_DESC' rs:number='2' rs:writeunknown='true'>
<s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='50' rs:maybenull='false'/>
</s:AttributeType>
<s:extends type='rs:rowbase'/>
</s:ElementType>
</s:Schema>
<rs:data>
<z:row RECORD_ID='0' RECORD_DESC='0 is OK!'/>
<z:row RECORD_ID='1' RECORD_DESC='1 is OK!'/>
<z:row RECORD_ID='0' RECORD_DESC='10 is wrong - comes out as 0'/>
<z:row RECORD_ID='12' RECORD_DESC='12 is OK'/>
<z:row RECORD_ID='0' RECORD_DESC='100 is wrong - comes out as 0'/>
<z:row RECORD_ID='20' RECORD_DESC='120 is wrong - comes out as 20'/>
<z:row RECORD_ID='0' RECORD_DESC='1200 is wrong - comes out as 0'/>
<z:row RECORD_ID='230' RECORD_DESC='1230 is wrong - comes out as 230'/>
<z:row RECORD_ID='300' RECORD_DESC='12300 is wrong - comes out as 300'/>
<z:row RECORD_ID='2340' RECORD_DESC='12340 is wrong - comes out as 2340'/>
</rs:data>
</xml>

Note that the RECORD_ID field is incorrect!! Somewhere along the line, for every 0 at the end of the RECORD_ID (when the RECORD_ID is not 0), a digit is removed from the beginning of the RECORD_ID!

This is KILLING me!!!

You will notice that there is a line of code that is commented out which uses the Microsoft OLE DB Provider for Oracle instead. This works fine and dandy. The trouble is I can't use it, as I need functionality in the Oracle provider that the MS provider doesn't have! OUCH!

Can anyone confirm that they get the same problems, or is there something else in my system that is messing things up??

Many thanks for any help!

James

Message was edited by:
JAMES_2JS
JAMES_2JS

Posts: 3
Registered: 01/17/06
Re: BUG With 10g OleDB Provider!
Posted: Mar 28, 2006 4:56 AM   in response to: JAMES_2JS in response to: JAMES_2JS
Click to report abuse...   Click to reply to this thread Reply
Hi again!

What I failed to mention is that this code works perfectly well with both the 8i and 9i OLEDB Providers!!

Cheers,

James
revenu2

Posts: 65
Registered: 02/10/00
Re: BUG With 10g OleDB Provider!
Posted: Apr 19, 2006 7:49 AM   in response to: JAMES_2JS in response to: JAMES_2JS
Click to report abuse...   Click to reply to this thread Reply
Hi,

We experience the same bug.

Did you find out what was going on ? Did you open a service request with Oracle and if so, what did they tell you to do ?

You can email me at : marco.gilbert@mrq.gouv.qc.ca

Thanks
viresh1

Posts: 18
Registered: 04/23/01
Re: BUG With 10g OleDB Provider!
Posted: Apr 21, 2006 11:25 AM   in response to: JAMES_2JS in response to: JAMES_2JS
Click to report abuse...   Click to reply to this thread Reply
Hello,
I am facing the same issue. I am using Ole DB templates in VC++.
The code works well with 10g R1 ole db provider but not with 10g R2. Is this a known issue ? I did not find any recent patches for ole db provider on oracle' site.
JAMES_2JS

Posts: 3
Registered: 01/17/06
Re: BUG With 10g OleDB Provider!
Posted: Apr 24, 2006 1:59 AM   in response to: JAMES_2JS in response to: JAMES_2JS
Click to report abuse...   Click to reply to this thread Reply
Hi!

Yes I have logged an SR (5294949.992) if you've got access to Metalink.

The last that Oracle have come back with is:

07-APR-06 18:31:20 GMT

Hi

You are running into Bug 4518457. This has been fixed in the Patch I told you about on 10.1.0.4 earlier
but has not made it into a release of 10.2.0.1 OraOleDB. I am checking to see if development knows when
the patch for this bug is coming out for 10.2.0.1 or if 10.2.0.2 is coming out soon.

Thanks
Karl Libby
Oracle Support

To be honest I'm extremely disappointed by this...
1) that the bug can slip back in... which shows that there is some poor quality control going on at Oracle...
2) that it is taking Oracle development so long to come back with anything!

Cheers,

James
revenu2

Posts: 65
Registered: 02/10/00
Re: BUG With 10g OleDB Provider!
Posted: May 1, 2006 5:31 AM   in response to: JAMES_2JS in response to: JAMES_2JS
Click to report abuse...   Click to reply to this thread Reply
Hi,

This is a major issue and we open a SR too but Oracle does seem to care much about it since it takes so long to get a fix.

This is very disapointing.

Bye
revenu2

Posts: 65
Registered: 02/10/00
Re: BUG With 10g OleDB Provider!
Posted: May 2, 2006 8:21 AM   in response to: JAMES_2JS in response to: JAMES_2JS
Click to report abuse...   Click to reply to this thread Reply
Hi,

Bug #4518457 has been updated on May 1st and it is indicated that it is fix in 11.0 !!!

We requested a backport for 10.2.

Bye
user529309

Posts: 2
Registered: 09/06/06
Re: BUG With 10g OleDB Provider!
Posted: Sep 6, 2006 3:02 PM   in response to: JAMES_2JS in response to: JAMES_2JS
Click to report abuse...   Click to reply to this thread Reply
Hi there!

We have the same problem with v10.2.0.1 Oracle client connected to 10g db.
Any patches?

Thanks.
user533476

Posts: 1
Registered: 09/28/06
Re: BUG With 10g OleDB Provider!
Posted: Sep 28, 2006 5:55 AM   in response to: JAMES_2JS in response to: JAMES_2JS
Click to report abuse...   Click to reply to this thread Reply
Hi,
it seems that the bugfix is included in patch 5473334
Provider for OLE DB: Patchset
ORACLE DATA ACCESS SOFTWARE FOR WINDOWS: ORACLE ODP.NET PATCHSET 10.2.0.2.20 10.2.0.2 18-AUG-2006 209M
Bug Fixes (in 10.2.0.2.20):
...
4518457 RECORDSET FIND METHOD FAILS TO WORK CORRECTLY WITH NUMERIC RECORDS
...
Too bad it did not solve the problem I have (but it may have some other reason)
Best regards, Alexander
nurhidayat

Posts: 737
Registered: 04/12/06
Re: BUG With 10g OleDB Provider!
Posted: Sep 28, 2006 9:28 PM   in response to: JAMES_2JS in response to: JAMES_2JS
Click to report abuse...   Click to reply to this thread Reply
It does not affect VS2005. I tried this code on
* Windows XP SP2 (with all the latest Windows Update Patches)
* Oracle Data Access Client v10.2.0.2.20

static void Main(string[] args)
{
try
{
// create connection
string cnString = "Provider=OraOLEDB.Oracle.1;User ID=hr;Password=hr;Data Source=//localhost/xe";
OleDbConnection conn = new OleDbConnection(cnString);

// create and fill dataset
OleDbDataAdapter da = new OleDbDataAdapter("select * from oledb_test", conn);
DataSet ds = new DataSet();
da.Fill(ds);

// write to XML
ds.WriteXml("c:\\temp
oledb_test1.txt");

// done
Console.WriteLine("XML file created, press any key...");
Console.ReadKey();
}
catch (Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
Console.ReadKey();
}
}
and the result is,

<?xml version="1.0" standalone="yes"?>
<NewDataSet>
<Table>
<RECORD_ID>0</RECORD_ID>
<RECORD_DESC>0 is OK!</RECORD_DESC>
</Table>
<Table>
<RECORD_ID>1</RECORD_ID>
<RECORD_DESC>1 is OK!</RECORD_DESC>
</Table>
<Table>
<RECORD_ID>10</RECORD_ID>
<RECORD_DESC>10 is wrong - comes out as 0</RECORD_DESC>
</Table>
<Table>
<RECORD_ID>12</RECORD_ID>
<RECORD_DESC>12 is OK</RECORD_DESC>
</Table>
<Table>
<RECORD_ID>100</RECORD_ID>
<RECORD_DESC>100 is wrong - comes out as 0</RECORD_DESC>
</Table>
<Table>
<RECORD_ID>120</RECORD_ID>
<RECORD_DESC>120 is wrong - comes out as 20</RECORD_DESC>
</Table>
<Table>
<RECORD_ID>1200</RECORD_ID>
<RECORD_DESC>1200 is wrong - comes out as 0</RECORD_DESC>
</Table>
<Table>
<RECORD_ID>1230</RECORD_ID>
<RECORD_DESC>1230 is wrong - comes out as 230</RECORD_DESC>
</Table>
<Table>
<RECORD_ID>12300</RECORD_ID>
<RECORD_DESC>12300 is wrong - comes out as 300</RECORD_DESC>
</Table>
<Table>
<RECORD_ID>12340</RECORD_ID>
<RECORD_DESC>12340 is wrong - comes out as 2340</RECORD_DESC>
</Table>
</NewDataSet>
user529309

Posts: 2
Registered: 09/06/06
Re: BUG With 10g OleDB Provider!
Posted: Oct 10, 2006 4:33 PM   in response to: JAMES_2JS in response to: JAMES_2JS
Click to report abuse...   Click to reply to this thread Reply
The same problem was fixed after patch 5206573.

This bug has already had a fix provided. If you look at patch id 5206573 you will see in the readme where this bug is already listed as fixed for 10.2:

This one-off is provided for OLEDB on top of 10.2.0.1
This includes the following bugs

1. Bug 4905051 - ORAOLEDB REPORTS PRECISION OF 255 FOR NUMBER WITH NO PRECISION/SCALE
2. Bug 4473586 - ORAOLEDB 10.1.0.4 GOES IN OVERFLOW OCI-22053
3. Bug 4518457 - RECORDSET FIND METHOD FAILS TO WORK CORRECTLY WITH NUMERIC RECORDS.
Legend
Guru Guru : 2500 - 1000000 pts
Expert Expert : 1000 - 2499 pts
Pro Pro : 500 - 999 pts
Journeyman Journeyman : 200 - 499 pts
Newbie Newbie : 0 - 199 pts
Oracle ACE Director
Oracle ACE Member
Oracle Employee ACE
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums