Skip to Main Content
Feature Request FR-4303
Product Area APIs
Status CLOSED

1 Voters

APEX PL/SQL API to Perform Search and Replace in CLOB Datatypes

jon dixon Public
· Mar 2 2025

Idea Summary
The database provides a native REPLACE function but no native function for easily performing a search and replace on a CLOB. The idea is to create an APEX_STRING_UTIL.SEARCH_AND_REPLACE function that works for CLOB datatypes. 

Use Case
Performing search and replace on CLOB data types. This would be helpful for searching and replacing text in HTML content stored in a CLOB.

Preferred Solution (Optional)
Create a new APEX_STRING_UTIL function called REPLACE_AND_REPLACE. Pass in a CLOB, an array of search terms, and an array of replace terms. e.g. 

l_new_clob := 
  APEX_STRING_UTIL.SEARCH_AND_REPLACE 
   (p_source  => l_source_clob,
    p_search  => apex_t_varchar2 ('HELLO','GOODBYE'),
    p_replace => apex_t_varchar2 ('Hello','Goodbye'));
We reviewed this idea carefully, and while it was interesting, we concluded that due to all the internal implications we need to take into account, it is unlikely to make its way into APEX.

Comments

Comments

  • vincent morneau Admin OP 11 days ago

    APEX_STRING_UTIL has plenty of useful utility functions, however they are for convenience on simple use cases. String manipulation is not APEX core competency. For advanced use cases we recommend building your own function.