I am trying to call an Oracle stored procedure and getting "Sequence contains no elements".
I changed it to firstordefault as many posts say but still get the same error. I changed the stored procedure to be as simple as possible just to see if I can get any results but I am unable to.
CREATE OR REPLACE
PROCEDURE get_registration
(returnRecords Out SYS_REFCURSOR)
IS
BEGIN
open returnRecords for
Select Admin_Comments
from registration
order by ID desc;
END; -- Procedure
/
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Oracle.ManagedDataAccess.Client;
using Oracle.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using SDD_Training.DataAccess.Repository.IRepository;
using SDD_Training.Models;
public int GetorCreateRegistration(Registration id)
{
if (id != null)
{
OracleParameter pout = new OracleParameter("returnRecords",
OracleDbType.RefCursor, ParameterDirection.Output);
object[] parameters = new object[] { pout };
var results = _db.RESULTS.FromSqlRaw("BEGIN get_registration(:returnRecords); END;", new object[] { parameters }).FirstOrDefault();