-- empvar.sql

DECLARE
	TYPE emp_var IS VARRAY(5) OF employee%ROWTYPE;
	emp emp_var := emp_var();
BEGIN
	emp.EXTEND;
	SELECT * INTO emp(1) FROM employee WHERE id = 7111;
	emp.EXTEND;
	SELECT * INTO emp(2) FROM employee WHERE id = 7881;

	emp.EXTEND;
	emp(3) := emp(2);
	emp(3).id := 10007;
	emp(3).store_number := 3;
	emp.EXTEND(2);

	emp.EXTEND;	-- Error! Subscript outside of limit!
END;
/


