declare
  -- SELECT returns many rows, bulk syntax

  -- static SQL
  -- fails at 9.0.1 with PLS-00597:
  -- expression 'V_EMPRECS' in the INTO list is of wrong type
  v_emprecs Emp_Util.emprec_tab_t;
  v_avg_hire_date employees.hire_date%type := '25-JUN-97';

  cursor cur is
    select * from employees where hire_date >= v_avg_hire_date;
  v_limit natural := 10;
begin
  open cur; fetch cur bulk collect into v_emprecs limit v_limit; close cur;
  Emp_Util.Show_All ( v_emprecs );

end;
/
-- PL/SQL procedure successfully completed.






declare
  -- alternative syntax, binding explicit column list
  -- to RECORD with corresponding structure
  -- fails at 9.0.1 with PLS-00597:
  -- expression 'V_EMPRECS' in the INTO list is of wrong type
  v_emprecs Emp_Util.emprec_tab_t;
  v_avg_hire_date employees.hire_date%type := '25-JUN-97';

  cursor cur is
    select 
        employee_id,
        first_name,
        last_name,
        email,
        phone_number,
        hire_date,
        job_id,

        salary,
        commission_pct,
        manager_id,
        department_id
      from employees
      where hire_date >= v_avg_hire_date;
  v_limit natural := 10;
begin
  open cur; fetch cur bulk collect into v_emprecs limit v_limit; close cur;
  Emp_Util.Show_All ( v_emprecs );

end;
/
-- PL/SQL procedure successfully completed.