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






Use DBMS_OUTPUT.PUT_LINE to output clob data

  

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.

   
    
  








Related examples in the same category

1.Displaying Hello World! to the Screen
2.Call dbms_output.disable
3.Call dbms_output.put_line to display text message
4.dbms_output.enable
5.EXECUTE DBMS_OUTPUT.ENABLE(10000)
6.dbms_output.put: display text without new line sign
7.Call dbms_output.new_line to create a new line
8.DBMS_OUTPUT.GET_LINES
9.Combine text and number in DBMS_OUTPUT.PUT_LINE
10.A small buffer
11.dbms_output.new_line
12.DBMS_OUTPUT.NEW_LINE: a new line sign
13.Use DBMS_OUTPUT.PUT_LINE to output the table collection indexed by BINARY_INTEGER
14.This script demonstrates the DBMS_OUTPUT package
15.Output Visual line break