I have declared a SELECT query into a cursor which takes 1 argument - the output of which is 1 row and 1 column containing an integer value. I am attempting to open this cursor to store the result into a variable and later print it.
But it is throwing an error: PLS-00306: wrong number or types of arguments in call to 'c1'
I am not sure what I am doing wrong, I have tried declaring return types/ arguments too, but nothing works. Please help.
Here's what I am working with:
DECLARE
dept_no int ;
cursor c1(Var1 date)
IS
SELECT dept_no
from Employees
where academic_period = 202050
and trunc(r_date) = to_date(:Var1, 'yyyy-mm-dd');
BEGIN
dbms_output.put_line('Department Number: ');
OPEN c1;
FETCH c1 INTO dept_no;
CLOSE c1;
END;
c1? - if it's more than one, you have to change thedept_novariable type.