Initialize the array and create two entries using the constructor
SQL>
SQL> SET ECHO ON
SQL> SET SERVEROUTPUT ON
SQL>
SQL> DECLARE
2 TYPE dept_array IS VARRAY(100) OF VARCHAR2(30);
3
4 depts dept_array;
5 inx1 PLS_INTEGER;
6
7 BEGIN
8 depts := dept_array ('Dept One','Dept Two');
9
10 FOR inx1 IN 1..2 LOOP
11 DBMS_OUTPUT.PUT_LINE(depts(inx1));
12 END LOOP;
13 END;
14 /
Dept One
Dept Two
PL/SQL procedure successfully completed.
SQL>
SQL>
SQL> --