CodeListing 4: The implementation of progwith

1  PROCEDURE progwith (str IN VARCHAR2)
 2  IS
 3     TYPE info_rt IS RECORD (
 4        NAME user_source.NAME%TYPE
 5      , text user_source.text%TYPE
 6     );
 7
 8     TYPE info_aat IS TABLE OF info_rt
 9        INDEX BY PLS_INTEGER;
10
11     info_aa info_aat;
12  BEGIN
13     SELECT NAME || '-' || line
14          , text
15     BULK COLLECT INTO info_aa
16       FROM user_source
17      WHERE UPPER (text) LIKE '%' || UPPER (str) || '%'
18        AND NAME != 'VALSTD'
19        AND NAME != 'ERRNUMS';
20
21     disp_header ('Checking for presence of '' || str || ''');
22
23     FOR indx IN info_aa.FIRST .. info_aa.LAST
24     LOOP
25        DBMS_OUTPUT.PUT_LINE (
26           info_aa (indx).NAME, info_aa (indx).text);
27     END LOOP;
28 END progwith;