Skip to content

Commit

Permalink
backport of r1012ab0b
Browse files Browse the repository at this point in the history
Fixes 667236 - Handle numeric types appropriately
  • Loading branch information
Veerapuram Varadhan committed Feb 14, 2011
1 parent 0c26f66 commit 04a2d46
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
@@ -1,3 +1,9 @@
2010-01-30 Veerapuram Varadhan <vvaradhan@novell.com>

** Fixes #667236 - Based on patch by Kalyanov.Dmitry@gmail.com
* OracleParameter.cs (GetOutValue): Handle OciDataType.Integer
appropriately using the underlying dbType.

2009-10-29 Veerapuram Varadhan <vvaradhan@novell.com>

** Fixes #322695
Expand Down
@@ -1,4 +1,4 @@
//
//
// OracleParameter.cs
//
// Part of the Mono class libraries at
Expand Down Expand Up @@ -1305,8 +1305,25 @@ private void GetOutValue (OracleCommand cmd)
OciCalls.OCICharSetToUnicode (env, ret, bytes, out rsize);

// if not empty, parse string as a decimal using session format
if (ret.Length > 0)
value = Decimal.Parse (ret.ToString (), cmd.Connection.SessionFormatProvider);
if (ret.Length > 0) {
switch (dbType) {
case DbType.UInt16:
value = UInt16.Parse (ret.ToString (), cmd.Connection.SessionFormatProvider);
break;
case DbType.UInt32:
value = UInt32.Parse (ret.ToString (), cmd.Connection.SessionFormatProvider);
break;
case DbType.Int16:
value = Int16.Parse (ret.ToString (), cmd.Connection.SessionFormatProvider);
break;
case DbType.Int32:
value = Int32.Parse (ret.ToString (), cmd.Connection.SessionFormatProvider);
break;
default:
value = Decimal.Parse (ret.ToString (), cmd.Connection.SessionFormatProvider);
break;
}
}
break;
case OciDataType.TimeStamp:
value = dateTimeDesc.GetDateTime (connection.Environment, dateTimeDesc.ErrorHandle);
Expand Down

0 comments on commit 04a2d46

Please sign in to comment.