SQL>
SQL> CREATE OR REPLACE PACKAGE xbuff
2 IS
3 contents DBMS_OUTPUT.CHARARR;
4 PROCEDURE dumpit;
5 END;
6 /
Package created.
SQL> CREATE OR REPLACE PACKAGE BODY xbuff
2 IS
3 PROCEDURE dumpit
4 IS
5 tempbuff DBMS_OUTPUT.CHARARR;
6 linenum PLS_INTEGER := 1000;
7 BEGIN
8 DBMS_OUTPUT.GET_LINES (tempbuff, linenum);
9 IF linenum > 0
10 THEN
11 linenum := tempbuff.FIRST;
12 LOOP
13 EXIT WHEN linenum IS NULL;
14 contents (NVL (contents.LAST, 0) + 1) := tempbuff(linenum);
15 linenum := tempbuff.NEXT (linenum);
16 END LOOP;
17 END IF;
18 END;
19 END;
20 /
Package body created.
SQL>