Calling stored procedure with an ulong input Parameter
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.