Search notes:

DBMS_OUTPUT.PUT_LINE

In SQL*Plus:
SQL> set serveroutput on
SQL> exec dbms_output.put_line('Hello world');

Writing (long) CLOBs

This example writes a clob with 600 characters while linesize is set to 320. Thus, SQL*Plus will insert a new line after 320 characters which distorts the written text.
Because the maximum value sthat can be set for linesize is 32767, the implication is that clobs longer than that cannot be faithfully be printed with dbms_output.put_line.
set serveroutput on format wrapped

set lines 320 -- Set to low value for brevity of text

declare
   out  clob;
begin
   out :=        '         1         2         3         4         5         6         7         8         9        |' || chr(10);
   out := out || '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789' || chr(10);
   out := out || '--------------------------------------------------------------------------------------------------|' || chr(10);
   out := out || 'This text contains 600 characters and demonstrates that clobs whose length exceed 32K (the        |' || chr(10);
   out := out || 'maximum value for linesize) cannot be printed correctly because SQL*Plus will insert a new line   |' || chr(10);
   out := out || 'after linesize.                                                                                   |' || chr(10);


   dbms_output.put_line('lenght of out = ' || length(out));
   dbms_output.put_line(out);

end;
/

See also

SQL*Plus: Displaying LOB (clob, blob) values
dbms_output
The SQL Server equivalent for dbms_output.put_line is roughly print.

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758206770, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/installed/packages/dbms/output/api/put_line(74): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78