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!

How to replace from clob variable

ronald_2017May 31 2022 — edited May 31 2022

Hello All,

I want to replace all ORA error codes to null, for clob variable. What do you recommend instead of writign each error message one by one?

Oracle 12c

declare
    v_clob clob := 'test1 test2 ORA-1234: test3 test4 


ORA-2435: test5 test6


test7 test8 ORA-1345: test9 test10';


    v_clob2 clob;
begin
    
    v_clob2 := replace(replace(replace(v_clob, 'ORA-1234:'), 'ORA-2435:'), 'ORA-1345:');
    dbms_output.put_line(v_clob2);




end;

Thanks

This post has been answered by Frank Kulash on May 31 2022
Jump to Answer
Comments
Post Details
Added on May 31 2022
2 comments
986 views