I am trying to execute a procedure that returns a stored procedure. My version of Oracle DB is 9.2 and the ODP .NET version is 10.2.0.100
My C# code looks like this.
OracleCommand od = new OracleCommand();
od.Connection = oc;
OracleParameter opBranchNo;
OracleParameter opSysRef;
od.CommandType = System.Data.CommandType.StoredProcedure;
od.CommandText = "pkg_fetchleaseinfo.proc_fetchleaseheader";
opBranchNo = new OracleParameter("IBRANCH_ID", OracleDbType.Varchar2, 3, "044");
opBranchNo.Direction = System.Data.ParameterDirection.Input;
od.Parameters.Add(opBranchNo);
opSysRef = new OracleParameter();
opSysRef.ParameterName = "REC_SET";
opSysRef.Direction = System.Data.ParameterDirection.Output;
opSysRef.OracleDbType = OracleDbType.RefCursor;
od.Parameters.Add(opSysRef);
od.Prepare();
od.ExecuteNonQuery();
Oracle.DataAccess.Types.OracleRefCursor sysref =
(Oracle.DataAccess.Types.OracleRefCursor)opSysRef.Value;
return sysref.GetDataReader();
//OracleDataReader dr1 =
//((Oracle.DataAccess.Types.OracleRefCursor)opSysRef.Value).GetDataReader();
//return dr1;
My Oracle Procedure code looks like this
PROCEDURE proc_fetchleaseheader(ibranch_id IN VARCHAR2,
rec_set OUT SYS_REFCURSOR) IS x_rec genericCursor;
BEGIN
OPEN x_rec FOR SELECT getleaseheaderrows(ibranch_id) FROM dual;
rec_set := x_rec;
EXCEPTION WHEN OTHERS THEN
RAISE;
END;
When I execute my code, the part where I attempt a GetReader() fails with an UNSUPPORTED COLUMN DATATYPE error message.