Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Locale Problem in ODP .net 10g

605350May 17 2008 — edited Dec 8 2010
Environment
WebServer - IIS
C# webservices on dotnet framework 2.0.
ODP .net 10x
Oracle client for 10g.
Oracle 9i DB.

The webservice code calls stored procedures having out parameters in format date, float and ref cursors. On the dev webserver machine the locale for the OS is english - US, oracle client is en-US. The dev DB also has english locale. So far so good.
The QA webserver machine is the locale is swedish, oracle client is en-US ( as the query
select to_date(sysdate,'d') from dual returns 6 for a friday) and DB is on a different machine. The values which come in refcursor e.g. dates from the stored procedure are returned in the OS format on both the dev and QA machines. ( m/d/yyyy for dev and yyyy-mm-dd for QA) so they behave correctly. But the out parameters like dates behave strangely. Both on the dev and QA machine the out parameter format is DD-MON-YY. This is an acceptable format for en-US locale on DEV machine but in swedish locale on QA machine the format is opposite ( YY - MON -DD). This makes C# convert it to the wrong date.

The same problem comes with decimal separator in a float out parameter. On both
machines the out parameter.value.ToString() gives Eg 2.8. On QA this causes an incorrect format exception since , is the accepted separator.

I have a few questions -
Why the diff in between ref cursor values and output values.
Is ODP .NET dependent on the oracle client locale to return results?

The last question might be off the scope of this forum , but If I change the OS locale on DEV machine, the behavior of the C# code does not change. Do I have to reboot the box
for doing that?

~Peeyush
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 5 2011
Added on May 17 2008
5 comments
2,050 views