I can't put my value of v_emp into my emp_table. It is all going wrong at this line: emp_table(counter) := v_emp;
The error that i get is: invalid use of type name of subtype name
I can't see what the problem is..
CREATE OR REPLACE PROCEDURE laatste_emp IS v_emp employees%ROWTYPE; TYPE emp_table is table of employees%ROWTYPE INDEX BY PLS_INTEGER; counter NUMBER := 0; BEGIN select * into v_emp from employees where hire_date = (select max(hire_date) from employees); dbms_output.put_line(v_emp.employee_id || ' ' || v_emp.last_name || ' ' || v_emp.hire_date); EXCEPTION WHEN TOO_MANY_ROWS THEN FOR i in 100 .. 206 LOOP select * into v_emp from employees where employee_id = i and hire_date = (select max(hire_date) from employees); IF SQL%FOUND THEN emp_table(counter) := v_emp; counter := counter + 1; END IF; END LOOP; END; /