static void Main(string[] args)
{
string constr = "User Id=hr; Password=hr;
Data Source=oramag; Pooling=false";
OracleConnection con = new OracleConnection(constr);
con.Open();
OracleCommand cmd = con.CreateCommand();
cmd.CommandText = "begin open :1 for
select * from employees
where manager_id=101; end;";
OracleParameter p_rc = cmd.Parameters.Add(
"p_rc",
OracleDbType.RefCursor,
DBNull.Value,
ParameterDirection.Output);
cmd.ExecuteNonQuery();
cmd.Parameters.Clear();
cmd.CommandText = "cursor_in_out.process_cursor";
cmd.CommandType = CommandType.StoredProcedure;
OracleParameter p_input = cmd.Parameters.Add(
"p_input",
OracleDbType.RefCursor,
p_rc.Value,
ParameterDirection.Input);
cmd.ExecuteNonQuery();
p_input.Dispose();
p_rc.Dispose();
cmd.Dispose();
con.Dispose();
}