Problem with stored Procedure Example from Documentation
Posted: Wed 12 Apr 2017 15:44
Hello,
I have problems getting this example from your Documentaion to work:
(Database Oracle 12c, Visual Studio 2015 CS,Latest dotConnectUniversal Professional Version, downloaded yesterday)
The Package EMPPKG with the stored Procedure SELECTEMP is created and working.
Code Example from your Documentation:
ConnStr = "provider=Oracle;User Id=scott;Password=tiger;Server=w7pdb;Unicode=True;Direct=True;Service Name=pdb_development;Persist Security Info=True;";
UniConnection connection = new UniConnection(ConnStr);
connection.Open();
UniCommand cmd = connection.CreateCommand();
connection.Open();
cmd.CommandText = "EMPPKG.SELECTEMP";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new UniParameter("DEPTNO", UniDbType.Int));
cmd.Parameters.Add(new UniParameter("CUR", UniDbType.Cursor));
cmd.Parameters["DEPTNO"].Value = 10;
cmd.Parameters["CUR"].Direction = ParameterDirection.Output;
cmd.ExecuteNonQuery();
UniCursor uniCursor = (UniCursor)cmd.Parameters["Cur"].Value;
uniDataAdapter1.Fill(dsTest, "EmpCursor", uniCursor);
//the last line throws exception:
uniDataAdapter1.Fill(dsTest, "EmpCursor", uniCursor);
ORA-01009: missing mandatory parameter
I have tried many things, but had no success..
Can you provide working C# Example for use with Ref Cursor Output Param ?
Thanks!
Marcus
I have problems getting this example from your Documentaion to work:
(Database Oracle 12c, Visual Studio 2015 CS,Latest dotConnectUniversal Professional Version, downloaded yesterday)
The Package EMPPKG with the stored Procedure SELECTEMP is created and working.
Code Example from your Documentation:
ConnStr = "provider=Oracle;User Id=scott;Password=tiger;Server=w7pdb;Unicode=True;Direct=True;Service Name=pdb_development;Persist Security Info=True;";
UniConnection connection = new UniConnection(ConnStr);
connection.Open();
UniCommand cmd = connection.CreateCommand();
connection.Open();
cmd.CommandText = "EMPPKG.SELECTEMP";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new UniParameter("DEPTNO", UniDbType.Int));
cmd.Parameters.Add(new UniParameter("CUR", UniDbType.Cursor));
cmd.Parameters["DEPTNO"].Value = 10;
cmd.Parameters["CUR"].Direction = ParameterDirection.Output;
cmd.ExecuteNonQuery();
UniCursor uniCursor = (UniCursor)cmd.Parameters["Cur"].Value;
uniDataAdapter1.Fill(dsTest, "EmpCursor", uniCursor);
//the last line throws exception:
uniDataAdapter1.Fill(dsTest, "EmpCursor", uniCursor);
ORA-01009: missing mandatory parameter
I have tried many things, but had no success..
Can you provide working C# Example for use with Ref Cursor Output Param ?
Thanks!
Marcus