Create the array object. Declare the name of the array and how PL/SQL should organize the array. For example, "DECLARE TYPE employee_table IS TABLE OF varchar2(50) INDEX BY binary_integer" creates an array named "employee_table" that accepts letters as entries and is sorted by a binary integer.
Add fields to the array object. Include the array index variable "i" that identifies each entry. For example, use the code "employee employee_table; i binary_integer" to add the fields "employee" and "i."
Start the loop. Type the command "Begin." Set the index variable "i" to the first cell you want the loop to populate. For example, "Begin i:=1;" starts the loop entering into "cell 1."
Enter the command for the loop. Use the commands and syntax of PL/SQL to code the operation you wish repeated. For example, "for emp_rec in (select last_name from employees) loop employee(i):=emp_rec.last_name; i:=i + 1; end loop; end;" populates an array with the values "last_name" from the "employees" table.