Re: MS Oracle Data Provider BUG: Data corrupt after 16 rows with O

From: Angel Saenz-Badillos[MS] (angelsa_at_online.microsoft.com)
Date: 07/20/04


Date: Tue, 20 Jul 2004 12:51:38 -0700

philipp,

I was not able to get to the bottom of the issue in the previous thread
since I never heard back from him, here was my suggestion to him that shows
how using MSDAORA to insert unicode data into utf8 results in garbage being
inserted (even though it looks like it works) and how to verify it.

Could you use this to check the data in your database? It is very likely
that this is not your problem, but it is easy to verify.
Thanks,
Angel

To verify this you can try the following:

Insert into EMP (Empno, Ename) values (1000, 'аий')

Once you have done this with both the Oracle managed provider and either
sqlplus or msdaora you can get the real values stored in the database like
this:

select dump(ename, 1016) from emp;

DUMP(ENAME,1016)

----------------------------------------------------------------------------

----
Typ=96 Len=10 CharacterSet=UTF8: e0,e8,e9,20,20,20,20,20,20,20     //invalid
utf-8 value  inserted with msdaora
Typ=96 Len=10 CharacterSet=UTF8: c3,a0,c3,a8,c3,a9,20,20,20,20     //аий
inserted with Oracle managed provider.
-- 
Angel Saenz-Badillos [MS] Managed Providers
This posting is provided "AS IS", with no warranties, and confers no
rights.Please do not send email directly to this alias.
This alias is for newsgroup purposes only.
I am now blogging about ADO.NET: http://weblogs.asp.net/angelsb/
"philipp" <philipp@discussions.microsoft.com> wrote in message
news:060ADEEA-8A30-4929-AAAE-3DB8FAD3AB6A@microsoft.com...
> Hello Frans , hello Angel,
>
> thank you for all your replies. It may help you to know how the data got
into the database. I tried several ways to fill in the data into the table:
>
> 1. Initial data were a dump from a former 8i UTF8 database. They were
imported into the 9i database without any errors (i tried 8i Client as well
as 9i client).
>
> 2. Second way i tried is the following: I made TOAD to generate an sql
script from the data with a lot of insert statements. Via TOAD (8i Client as
well as 9i Client, tried both on different machines) i loaded the data into
the table by the sql script. Before, I tried truncating the table as well as
dropping and recreating the table.
>
> To me, it still seems to be an ODP / MSDPO issue OR an Oracle Client
(9.2.0.1.) issue. I cannot imagine how simple ascii-sql-scripts could lead
to corrupt data encodings or whatsoever. Also I cannot imagine that the
database itself (9.2.0.4 on W2003Server) makes such simple errors in the
Online-Converting. Although, this may be a hint, the problem disappears when
I tell the client (via registry) to use WE8MSWIN1252 instead of UTF8.
>
> Another hint may be the following: We had exactly the same problem 1,5
years ago when we were using ODP and 8i Client / 8i Database. The second
prefetch of rows lost one or some bytes and data were corrupt. A former team
member informed me that the problem disappeared when they switched from ODP
(at that time) to MS Data Provider.
>
> Any other ideas ?
>
> Angel, you had a similar thread in another group 0,5 years ago with a
developer from poland. Could you help him at that time? How?
>
> Thanks a lot in advance,
>
> Philipp.
>
>
> "Angel Saenz-Badillos[MS]" wrote:
>
> > I was thinking more along the lines of invalid UTF 8 data having been
> > inserted into the Oracle database. This is surprisingly easy to do and
hard
> > to catch. By default some providers and sqlplus are not safe to use with
> > Unicode into a UTF8 database, when you insert Unicode data it inserts
> > "garbage". This is hard to catch because reading back the "garbage" data
> > with the same provider that you used to insert it will return the data
you
> > where expecting. True Unicode providers like odp.net and the oracle
managed
> > provider will instead return the "garbage". The best way to verify this
is
> > to do a "select dump(<row>, 1016) from  <yourtable>" and use a utf8
> > converter to verify that the data in the database is correct.
> >
> > -- 
> > Angel Saenz-Badillos [MS] Managed Providers
> > This posting is provided "AS IS", with no warranties, and confers no
> > rights.Please do not send email directly to this alias.
> > This alias is for newsgroup purposes only.
> > I am now blogging about ADO.NET: http://weblogs.asp.net/angelsb/
> >
> >
> >
> >
> > "Frans Bouma [C# MVP]" <perseus.usenetNOSPAM@xs4all.nl> wrote in message
> > news:xn0dkyszusv731000@msnews.microsoft.com...
> > > Angel Saenz-Badillos[MS] wrote:
> > >
> > > > It is really strange that both ODP.NET and the Oracle Client managed
> > > > provider are running into this question, especially since your
database
> > is
> > > > using UTF8. How did you insert the data? Can you do a select dump to
get
> > the
> > > > actual value inserted in the database and verify that the data was
> > inserted
> > > > correctly?
> > >
> > > ... perhaps it's something with the oracle client (thus not the
provider,
> > > but the actual client software the provider talks to) settings.
> > >
> > > FB
> >
> >
> >


Relevant Pages

  • Re: application design problem
    ... Actual action is depends on your Provider which provide service for a particual database or data store. ... When I would click Button1 this sql would execute: ... I dont think its a good idea to put all your client spcific logic ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: application design problem
    ... I've looked at the provider model. ... > I dont think its a good idea to put all your client spcific logic in UI. ... > Instead I will suggest that you create different Usercontrol for different ... what is the correct way to include database queries into ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Deleting an instance from with in a provider.
    ... the database might disapear and the client is not notified when it gets ... Does this require that my instance provider also requires to ... >> The instances are not maintained by WMI so there are gone once they got ...
    (microsoft.public.win32.programmer.wmi)
  • Re: Opinions needed about the best "Middleware suite" kbmMW vs. RODA
    ... kbmMW supports cross db in such way that all you need to do in your application is to set one property to switch to ... What one have to concentrate about is minimizing the amount of data moved from the app server to the client. ... C/S setup's usually have a quite active chatter going on between the client and the database, ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Access 2003 Macro Security Modification
    ... the desired way to prevent the macro security warning is to ... digitally sign your database. ... Your database fileon the client computer. ...
    (microsoft.public.access.modulesdaovba)