UTF8 Character Set issues with Oracle Provider

  • Thread starter Thread starter Brian Baker [MVP]
  • Start date Start date
B

Brian Baker [MVP]

We are building an application with VB.NET on the .NET Framework 1.1 and
the .NET Managed Provider for Oracle. We are connecting to an Oracle
9.2.0 server on HP-UX using the 8.1.7 client. The character set on the
server instance is "AL32-UTF8".

When we call OracleCommandBuilder.DeriveParameters(), we get the following
exception:

System.Data.OracleClient.OracleException:
ORA-06550: line 1, column 72:
PLS-00553: character set name is not recognized
ORA-06550: line 0, column 0:
PL/SQL: Compilation unit analysis terminated

KB 322158 seems to indicate that there are some issues when UTF character
sets and NCHAR, NVARCHAR2, or NCLOB data types with the Oracle 8.1.7
client. In our case, we are using standard CHAR, VARCHAR2, and CLOB data
types.

If the Oracle client is upgraded to 9.2, the exception is not thrown.
However, we would like to avoid upgrading the Oracle client, as there is a
large number of machines with the 8.1.7 client already installed.

Can anyone else shed some additional light on the issue?

Thanks,
Brian Baker
 
Hi Brian,

Thank you for using MSDN Newsgroup! My name is Kevin, and I will be
assisting you on this issue.

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you receive and exception when calling
the OracleCommandBuilder.DeriveParameters() method. If there's any
misunderstanding, please feel free to let me know.

I'd like to know if this method is called within a transaction. As far as I
know, without a transaction, you cannot use a CLOB parameter type (with a
value that is a System.String) when using a stored procedure to perform
data adapter updates, but you can use it when using an insert statement in
the same code.

Also, I will do some further research and will update you as soon as I get
any progress.

If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Kevin said:
First of all, I would like to confirm my understanding of your issue.
From your description, I understand that you receive and exception when
calling the OracleCommandBuilder.DeriveParameters() method. If there's
any misunderstanding, please feel free to let me know.

Yes, the Exception is thrown when that statement is executed.
I'd like to know if this method is called within a transaction. As far
as I know, without a transaction, you cannot use a CLOB parameter type
(with a value that is a System.String) when using a stored procedure to
perform data adapter updates, but you can use it when using an insert
statement in the same code.

No, there is not a transaction in place. In this instance, the
OracleCommand is associated with a procedure in a package that is
returning a REF CURSOR as an OUT parameter and has no input parameters.
Also, I will do some further research and will update you as soon as I
get any progress.

Thanks Kevin!

Brian Baker
 
Hi Brian,

I have done some further research and found that the Oracle client 8.1.7
doesn't support AL32-UTF8 encoding. So when you are manipulating data
encoded with AL32-UTF8, there will be an exception.

I have checked the Oracle's website and found this document. Here is an
official white paper from Oracle about the globalization support. We can
see that AL32-UTF8 encoding is supported since Oracle 9i.

http://otn.oracle.com/tech/globalization/pdf/Unicode.PDF

So I think the workaround is to use a supported encoding on server
instance, such as UTF8 or UTF16 instead. Or you have to upgrade Oracle
Client on each computer.

If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Hi Kevin,

Thanks for the link to the Oracle white paper. I read through it and
there is a small section on page 14 that seems to indicate that the Oracle
8.1.7 client will work with AL32-UTF8. This is in the section titled "Can
my pre-Oracle9i database client software communicate with the 2 new
Unicode character sets AL32UTF8 & AL16UTF16 in Oracle9i?"

Maybe this is just a limitation of the .NET Managed Provider for Oracle as
indicated in KB 322158.

We'll look into upgrading our Oracle clients.

Thanks,
Brian Baker
 
Back
Top