Как вызвать функцию oracle в C# ?
I have an oracle function,which takes 3 parametes and return records which has four columns. But I am getting an exception which is ORA-06550: line 1, column 7: PLS-00221: 'get_receipts' is not a procedure or is undefined this is my code. cmd.CommandText = "get_receipts"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new OracleParameter("p_store_num", store_num)); cmd.Parameters.Add(new OracleParameter("p_create_dt", create_date)); cmd.Parameters.Add(new OracleParameter("p_cc_last4", cc_last4)); } OracleDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { ResponseModel sample = new ResponseModel(); sample.Field1 = dr.GetString(0); sample.Field2 = dr.GetString(1); sample.Field3 = dr.GetString(2); sample.Field4 = dr.GetString(3); response.Add(sample); }
Что я уже пробовал:
this is my code. cmd.CommandText = "get_receipts"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new OracleParameter("p_store_num", store_num)); cmd.Parameters.Add(new OracleParameter("p_create_dt", create_date)); cmd.Parameters.Add(new OracleParameter("p_cc_last4", cc_last4)); } OracleDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { ResponseModel sample = new ResponseModel(); sample.Field1 = dr.GetString(0); sample.Field2 = dr.GetString(1); sample.Field3 = dr.GetString(2); sample.Field4 = dr.GetString(3); response.Add(sample); }