PL/SQL explicit cursor in vs code
I work in vs code(I installed the SQL developer extension) and i keep having the same error while using explicit cursor, I don’t understand what’s wrong:
Error starting at line : 2 in command –
DECLARE
CURSOR a_cursor IS
SELECT id_angajat, nume, prenume, data_angajarii
FROM angajati
WHERE EXTRACT(YEAR FROM data_angajarii) = 2020;
a_record angajati%ROWTYPE;
BEGIN
DBMS_OUTPUT.PUT_LINE(‘Lista angajatilor: ‘);
OPEN a_cursor;
IF a_cursor%FOUND THEN
LOOP
FETCH a_cursor INTO a_record;
EXIT WHEN a_cursor%NOTFOUND;
DBMS_OUTPUT.PUT_LINE (a_record.id_angajat || ‘, ‘ || a_record.nume || ‘, ‘ || a_record.prenume || ‘, ‘ || a_record.data_angajarii);
END LOOP;
ELSE
DBMS_OUTPUT.PUT_LINE (‘Nu s-au gasit angajati’);
END IF;
CLOSE a_cursor;
END;
Error report –