SQL>
SQL> SET ECHO ON
SQL> SET SERVEROUTPUT ON
SQL>
SQL> DECLARE
2 TYPE num_table IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
3
4 nums num_table;
5 some_num NUMBER;
6 BEGIN
7 nums(10) := 11;
8
9 BEGIN
10 some_num := nums(11);
11 EXCEPTION
12 WHEN NO_DATA_FOUND THEN
13 DBMS_OUTPUT.PUT_LINE('Element 11 does not exist.');
14 END;
15
16 IF nums.EXISTS(11) THEN
17 some_num := nums(11);
18 ELSE
19 DBMS_OUTPUT.PUT_LINE('Element 11 still does not exist.');
20 END IF;
21 END;
22 /
Element 11 does not exist.
Element 11 still does not exist.
PL/SQL procedure successfully completed.
SQL>
SQL> --
|