SQL> DECLARE
2 TYPE num_tab IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
3 myTable num_tab;
4 v_num NUMBER :=13;
5 BEGIN
6 myTable(1):=1001;
7 myTable(10):=1002;
8 myTable(-10):=1003;
9 myTable(v_num):=1004;
10
11 dbms_output.put_line(to_char(myTable(1))||' '||
12 to_char(myTable(10))||' '||
13 to_char(myTable(-10))||' '||
14 to_char(myTable(v_num)));
15 END;
16 /
1001 1002 1003 1004
PL/SQL procedure successfully completed.
|