DBMS_OUTPUT.CHARARR : DBMS_OUTPUT « System Packages « Oracle PL/SQL Tutorial






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>
SQL>








31.17.DBMS_OUTPUT
31.17.1.DBMS_OUTPUT.CHARARR
31.17.2.q for quotation with []
31.17.3.Output character or line
31.17.4.Output varchar variable
31.17.5.EXECUTE DBMS_OUTPUT.ENABLE(10000)
31.17.6.Use DBMS_OUTPUT.PUT_LINE to output clob data
31.17.7.Use DBMS_OUTPUT.PUT_LINE to output the table collection indexed by BINARY_INTEGER
31.17.8.Call substr in DBMS_OUTPUT.PUT_LINE
31.17.9.Output Visual line break
31.17.10.dbms_output.new_line
31.17.11.Output employee name with pl/sql, cursor and dbms_output.put_line