+5  A: 

I've just compiled your package, in PL/SQL Developer it works fine.

The problem seems to be with the datatypes in your C# code.

From what I see in description, you don't bind any parameters. You should bind parameters somewhere in your code, like

OracleParameter bid = new OracleParameter("bookmarkID", OracleDbType.Number);
bid.Direction = ParameterDirection.Output;
command.Parameters.Add(bid);

If there are lots of abstractions you need to deal with, you may redefine you procedure as a function:

FUNCTION procGet_Bookmark_Id RETURN INTEGER
IS
  res INTEGER;
BEGIN
  SELECT seq_bookmarks.nextval
  INTO res
  FROM dual;
  RETURN res;
END procGet_Bookmark_Id;

and call it in a SELECT query:

SELECT bookmarks.procGet_Bookmark_id FROM dual;

, which you seem to be able to do.

Quassnoi
You are right, I'm not binding any parameters, I guess I didn't realize I needed to bind output paramaters in my C# code. Sorry about not posting .net commands, I was just hoping what I posted would be enough, the actual C# commands are behind a ton of abstraction that was written long before me.
Carter
+2  A: 

The error: "Wrong number or types of arguments in call to blah" refers to errors in the calling code, not the called code.

You should check the following:

  • The parameter you're passing is a NUMBER or a type that can be easily converted from a NUMBER.
  • The parameter you're passing is a variable, as opposed to a literal or constant.
darreljnz
See this is something I'm confused about. I'm not passing any parameters into the proc. Should I be? The query should just be asking for the seq.nextval, does creating it like procedure procGet_Bookmark_Id(bookmarkId out NUMBER); require a number to be passed?
Carter
@Carter: Yes. If you declare an OUT parameter, you need to pass a parameter from the calling code that will receive the value set by the procedure.
Dave Costa
+1  A: 

I believe you need to pass in the parameter in your .net code. The name you give the parameter needs to be identical in the .net code and the procedure definition.

-OR-

Use a PL/SQL function instead of a procedure. You won't need to use a parameter at all.

Edit: Assuming you are using the Microsoft Provider you will need a return parameter. Here is the .net code.

// proc is the procedure name, oraConn is the oracle connection
OracleCommand cmd = new OracleCommand(proc, oraConn);
cmd.CommandType = System.Data.CommandType.StoredProcedure;

OracleParameter ret = new OracleParameter();
ret.Direction = System.Data.ParameterDirection.ReturnValue;
ret.OracleType = OracleType.Number;
cmd.Parameters.Add(ret);
Daniel Emge