Sudipta Saha

Sudipta Saha

  • NA
  • 85
  • 13.6k

what is the C# code to read types.cursortypes in procedure

Jan 2 2018 1:55 AM
I have a stored procedure like this
  1. PROCEDURE PRC_ABCD_GETALL (resultset_out OUT TYPES.cursorType)  
  2. AS  
  3. BEGIN  
  4. OPEN  
  5. resultset_out FOR SELECT * FROM ABCD;  
  6. END PRC_ABCD_GETALL;  
And my C# code is
  1. using (OracleConnection conn = new OracleConnection(cnn))  
  2. {   
  3.    conn.Open();   
  4.    OracleCommand cmd = new OracleCommand();   
  5.    cmd.Connection = conn;   
  6.    cmd.CommandText = "PRC_ABCD_GETALL";   
  7.    cmd.CommandType = CommandType.StoredProcedure;   
  8.    cmd.Parameters.Add("resultset_out", OracleType.Cursor, ParameterDirection.Output);   
  9.    OracleDataReader rdr = cmd.ExecuteReader();   
  10.    while (rdr.Read())   
  11.    {       
  12.       result.Add(Construct(rdr));   
  13.    }  
  14. }  
but I'm getting error 'OracleDbType' does not contain a definition for 'Cursor' in
OracleType.Cursor. Any solution for this??

Answers (7)