I am required to use an explicit cursor with a parameter that accepts car registration to find the most recent reservation made on the car. I cannot use the MAX function. I have to compare all the relevant dates to find the most recent one.
This is what I have so far"
Declare
v_rec_date DATE;
Cursor date_cur (v_reg VARCHAR2) IS
SELECT * FROM i_booking
WHERE registration = v_reg;
v_date date_cur%ROWTYPE;
Begin
FOR v_date IN date_cur LOOP
DBMS_OUTPUT.PUT_LINE('Recent Rental Date:'|| ' '||v_rec_date);
END LOOP;
End;
However this is giving me the error:
FOR v_date IN date_cur LOOP
*
ERROR at line 8:
ORA-06550: line 8, column 15:
PLS-00306: wrong number or types of arguments in call to 'DATE_CUR'
ORA-06550: line 8, column 1:
PL/SQL: Statement ignored
Where am I going wrong here?