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!

Problem in retrieving a number return value from stored function

447110Jul 13 2005 — edited Jul 16 2005
I have a problem in returning a number data type from a stored function.

My function accepts parameters like x,y and returns a number to my BLL component in DOT NET(C#). All the parameter bindings are done correctly and if I try to assign the return value from the stored function(which is of OracleDbType.Decimal type) I get a System.Invalid Cast Exception error in Dot Net.

For Ex. the parameter name which returns the return value is OraParamRetVal and I get the above error in the following line:

int tempvar = OraParamRetVal.Value;

To overcome the above error, I am Converting the return value to a string and then back to integer as given below:
int tempvar = Convert.ToInt32(OraParamRetVal.Value.ToString());

Is there any direct way of getting the (Number) return value without converting it to string.

Thanks n advance.

K R Chandra Sekar
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 13 2005
Added on Jul 13 2005
4 comments
1,508 views