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!

Calling stored procedure with an ulong input Parameter

834046Jan 25 2011
Hello,

I have a Problem and hope someone can help me.

I want to call a stored procedure/function and a input Parameter is an ulong.

here's what i do (c# Code).

cmd is a OracleCommand Object

...
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "myStoredProcedure";

OracleParameter returnParam = new OracleParameter("ret", OracleDbType.Int64, ParameterDirection.ReturnValue);
cmd.Parameters.Add(returnParam);

cmd.Parameters.Add(new OracleParameter
{
ParameterName = "p_ulong",
Value = anyObject.uLongParam, // the Value is a ulong
OracleDbType = OracleDbType.Int64, // here is the Problem see below
Direction = ParameterDirection.Input,
});
...

if i execute this it crashes with an System.ArgumentException.

the Datatype of the Colum in the Database is an Number

and thats the Procedure i'm calling
FUNCTION myStoredProcedure
( p_ulong IN ulong%type )
RETURN NUMBER;

When the Value is an long it works fine.
I already tried to set the OracleDbType to OracleDbType.Decimal, but this hasn't worked.


Thank you.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 22 2011
Added on Jan 25 2011
0 comments
187 views