I am new to oracle. I created a stored procedure to fetch table data.
create or replace
procedure GETLATESTNEWS(cv_results in out sys_refcursor)
as
begin
open cv_results for
select news from tbl_newsdetails;
EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
RAISE_APPLICATION_ERROR(-99999,'Not Inserted due to :'||SQLERRM);
end;
The procedure got compiled successfully. But in my .net code I am getting error
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'GETLATESTNEWS'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
My .net code is
con.ConnectionString = constring;
con.Open();
OracleCommand cmd = new OracleCommand();
cmd.Connection = con;
cmd.CommandText = "GETLATESTNEWS";
cmd.CommandType = CommandType.StoredProcedure;
rdr = cmd.ExecuteReader();
What might be the issue?. I am able to insert with insert stored procedure. But select is not working.
Try to add: