1

I'm trying to call an Oracle stored procedure. This procedure, has 2 input paramters (first is decimal, second is DateTime), the third is an output cursor.

I tried several code but no way, impossible to get data .... one parameter si missing (the output)

I tried this :

OracleConnection con = new OracleConnection();
con.ConnectionString = "....";
OracleCommand command = new OracleCommand("mypackage.myprocedure", con);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.AddWithValue("param1", SqlDbType.Decimal).Value = 613;
command.Parameters.AddWithValue("param2", SqlDbType.DateTime).Value = mytime;

con.Open();
OracleDataAdapter adapter = new OracleDataAdapter(command);
DataSet ds = new DataSet();
adapter.Fill(ds);
con.Close();

Do you have an idea ?

Thanks,

1
  • Have you tried with output datatype as string / varchar2 ? Commented Oct 28, 2009 at 9:34

1 Answer 1

1

You need to set variable direction if you want it as output .

i.e.:

command.Parameters.Add("output", OracleType.Number).Direction = ParameterDirection.Output

read more here:

http://discuss.itacumens.com/index.php?topic=44798.0

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.