SQL> DECLARE
2 Type t_LastNameTable IS TABLE OF VARCHAR(20)
3 INDEX BY BINARY_INTEGER;
4 v_LastNames t_LastNameTable;
5 v_Index BINARY_INTEGER;
6 BEGIN
7 -- Insert rows in the table.
8 v_LastNames(43) := 'A';
9 v_LastNames(50) := 'B';
10 v_LastNames(47) := 'C';
11
12 -- Assigns 43 to v_Index.
13 v_Index := v_LastNames.FIRST;
14
15 DBMS_OUTPUT.put_line(v_Index);
16
17 -- Assigns 50 to v_Index.
18 v_Index := v_LastNames.LAST;
19 DBMS_OUTPUT.put_line(v_Index);
20
21 END;
22 /
43
50
PL/SQL procedure successfully completed.
SQL>
SQL>
|