Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Is there a way to print clob variable as is?

ronald_2017Jun 28 2022

Hello All,

In Oracle 12c, is there a way to print clob variable as is? I mean, I want to print the clob variable completely as it is.

I know the following link but we don't use APEX. So, what do you recommend?

Split CLOB into lines | Jeff Kemp on Oracle (0 Bytes)
Also the following code is not print clob variable as is, it can divide it.

 CREATE OR REPLACE PROCEDURE print_clob_to_output (p_clob IN CLOB)  
 IS  
   l_offset     INT := 1;  
 BEGIN  
   dbms_output.put_line('Print CLOB');    
    loop  
        exit when l_offset > dbms_lob.getlength(p_clob);  
        dbms_output.put_line( dbms_lob.substr( p_clob, 255, l_offset ) );  
        l_offset := l_offset + 255;  
    end loop;  
 END print_clob_to_output;

Oracle Live SQL - Script: print_clob_to_output (0 Bytes)
Thanks

This post has been answered by Solomon Yakobson on Jun 29 2022
Jump to Answer
Comments
Post Details
Added on Jun 28 2022
11 comments
5,511 views