Use DBMS_OUTPUT.PUT_LINE to output clob data : DBMS_OUTPUT « System Packages « Oracle PL/SQL Tutorial






SQL> CREATE TABLE nmyTable (
  2    id INTEGER PRIMARY KEY,
  3    nclobData NCLOB
  4  );

Table created.

SQL> CREATE TABLE myTable (
  2    id INTEGER PRIMARY KEY,
  3    clobData CLOB
  4  );

Table created.

SQL>
SQL> CREATE OR REPLACE PROCEDURE nclob_example
  2  AS
  3    clobVariable CLOB := 'It is the east and Juliet is the sun';
  4    nclobVariable NCLOB;
  5  BEGIN
  6    INSERT INTO nmyTable (id, nclobData) VALUES (1, clobVariable);
  7
  8    SELECT nclobData INTO clobVariable FROM nmyTable WHERE id = 1;
  9
 10    DBMS_OUTPUT.PUT_LINE('clobVariable = ' || clobVariable);
 11  END nclob_example;
 12  /

Procedure created.

SQL>
SQL> drop table myTable;

Table dropped.

SQL> drop table nmyTable;

Table dropped.








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