Friday, 29 March 2019

How to replace a string in a CLOB file in SQL


We can replace the key with respective value in a CLOB in sql with replace function.

test_clob     CLOB;      // Type of test_clob is CLOB


test_clob := replace(test_clob, 'http', 'https');

This command will replace all occurrence of http with https from test_clob and store that in same file.


Note:  Don't change this in buffer while writing data to CLOB. With this it will replace but after last occurrence of the key it will not append data to the file.

test_lob.writeappend(test_clob, length(buffer), REPLACE(buffer,'http','https'));

No comments:

Post a Comment

Thank You for your valuable comment

Difference between class level and object locking and static object lock

1) Class level locking will lock entire class, so no other thread can access any of other synchronized blocks. 2) Object locking will lo...