Referencing a Nested Table Element
DECLARE
TYPE roster IS TABLE OF VARCHAR2(15);
names ROSTER := Roster('D Caruso','J Hamil','D Piro','R Singh');
PROCEDURE Verify_name
(the_name VARCHAR2)
IS
BEGIN
dbms_output.Put_line(the_name);
END;
BEGIN
FOR i IN names.FIRST.. names.LAST LOOP
IF Names(i) = 'J Hamil' THEN
dbms_output.Put_line(Names(i)); -- reference to nested table element
END IF;
END LOOP;
Verify_name(Names(3)); -- procedure call with reference to element
END;
/
0 comments:
Post a Comment