Re: ORA-06512

From: <stas1979_at_msn.com>
Date: Wed, 11 Feb 2009 06:42:05 -0800 (PST)
Message-ID: <b551ab33-530f-4b4d-89b8-f342912f6d84_at_g1g2000pra.googlegroups.com>



On Feb 11, 3:04 am, "Vladimir M. Zakharychev" <vladimir.zakharyc..._at_gmail.com> wrote:
> On Feb 10, 6:01 pm, stas1..._at_msn.com wrote:
>
>
>
>
>
> > On Feb 7, 2:50 am, "Vladimir M. Zakharychev"
>
> > <vladimir.zakharyc..._at_gmail.com> wrote:
> > > On Feb 6, 2:55 am, stas1..._at_msn.com wrote:
>
> > > > Hi,
>
> > > > I have a .NET application which gets back a CLOB from the oracle
> > > > database. I'm using OracleParameter("name", OracleType.Clob) for the
> > > > parameter spec. We recently created a new Oracle AL32UTF8 unicode
> > > > database, and I'm trying to run the app against the database, however
> > > > I'm getting the ORA-06512 exception. The application works fine
> > > > against a non-unicode database. The OUT variables in the stored
> > > > procedure are defined as CLOB, and actaully when I call the stored
> > > > procedure out of PL/SQL Developer the CLOB come back fine. Is there
> > > > anything that I need to do in the .NET app to get to work with
> > > > unicode?
>
> > > ORA-6512 is error stack backtrace message (that is, it's being output
> > > for each error stack entry as the error stack of an unhandled
> > > exception that was raised in a stored procedure unwinds.) What's the
> > > exception itself? Can you provide full error stack and relevant PL/SQL
> > > code where it's being raised?
>
> > > Regards,
> > >    Vladimir M. Zakharychev
> > >    N-Networks, makers of Dynamic PSP(tm)
> > >    http://www.dynamicpsp.com
>
> > Vladimir,
>
> > Here is the full error:
>
> > ORA-06512: at "SA.PKG_TEST", line 963
> > ORA-06512: at line 1
>
> >    at System.Data.OracleClient.OracleConnection.CheckError
> > (OciErrorHandle errorHandle, Int32 rc)
> >    at System.Data.OracleClient.OracleCommand.Execute
> > (OciStatementHandle statementHandle, CommandBehavior behavior, Boolean
> > needRowid, OciRowidDescriptor& rowidDescriptor, ArrayList&
> > resultParameterOrdinals)
> >    at System.Data.OracleClient.OracleCommand.ExecuteNonQueryInternal
> > (Boolean needRowid, OciRowidDescriptor& rowidDescriptor)
> >    at System.Data.OracleClient.OracleCommand.ExecuteNonQuery()
> >    at NotificationApp.AudioEmailConfirmations.ProcessOrder(Int64
> > alOrderID, Char acRevenueType, Char acConfirmationType)
>
> > Thank you!
>
> This is still not the exception itself, but the place where it was
> raised: at line 963 of the PKG_TEST package. Can you post the code
> around (and including) this line and re-check the error message for
> the exception? (it could be displayed in the message box title) Seeing
> the call to ExecuteNonQuery() may also help. You see, the more
> relevant information you provide, the easier it is to diagnose the
> issue and suggest corrective action.
>
> Regards,
>    Vladimir M. Zakharychev
>    N-Networks, makers of Dynamic PSP(tm)
>    http://www.dynamicpsp.com- Hide quoted text -
>
> - Show quoted text -

Vladimir,

Line 963 is actually is where the exception is raised. There is actually nothing wrong with the package procedure code, the issue is with .NET Data.Oracle.OracleClient handling the CLOBs that Oracle is returning. When I call the that procedure out of different applications, it comes back fine. It also comes back fine when the database character set is single byte such as WE8ISO8859P1 or WE8MSWIN1252. I think that the problem here is passing CLOBs between a Unicode UTF8 database, (which stores CLOBs in a UCS-2 format doubles the size). I was hoping that someone ran into this issue in the past, and had a quick solution for it. I know that one possible fix is to use the OracleDataReader and pass back the data as a stream, however that would require us to redesign the app. But I guess nothing is easy :)

Than you! Received on Wed Feb 11 2009 - 08:42:05 CST

Original text of this message