Hi,

I have a problem to call a stored function with a C# application.
I have tested the function directly on Oracle Server and the function is
well compiled and it runs on SQL*PLUS.

I think the problem is due on the RETURN parmeter, because if I create a
procedure without a return valule the procedure can be called by my C#
application.

So the Oracle Function is returning an INT (Oracle). To call it on the
console (it runs), I'm using the following code :

---------------------------------------------------------------
DECLARE STATUS INT;
BEGIN
STAUS := MYFUNCTION();
END;
----------------------------------------------------------------

The code inserted in the C# application is the following:
-----------------------------------------------------------------
OracleParameter oF = new OracleParameter();
...
oF = cmd.Parameters.Add(
"RETOUR",
OracleDbType.Int32, ParameterDirection.ReturnValue);

cmd.CommandText = procName;
cmd.CommandType = CommandType.StoredProcedure;
Connection.Open();
cmd.ExecuteNonQuery();
Console.WriteLine(oF.Value);
Connection.Close();
...
-----------------------------------------------------------------

When "cmd.ExecuteNonQuery()" is called I obtained the message:
ORA-06502: PL/SQL : numeric error or error on a value : conversion error
from characters to numbers.

If I don't declare the "oF" parameter, I obtain:
PLS-00221: 'MYFUNCTION' isn't a procedure or is undefined.

If someone had the same problem, thanks to give me more information.