Problem: I am looking for ways in which I can use a replacement for regex_replace function in my sql query as I am using 5.7 version.
Aim: I have created a java class which does the following:
- Creates connection to the db.
- Creates an update query using regex_replace which masks the column value as: -> value: name=xyz|department=office|number=123456 to newvalue: name=xyz|department=office|number=XXXX56
- Executes the query on millions of record in batches of few thousand rows.
Now, I tried running the same on sql 5.7 version but it says regex_replace function not found. Can someone suggest an easy way that I need to change in the java code to handle any new implementation of regex_replace function. If I need to use any stored sql procedures I am not sure what changes I need to make in the code. Please provide a simpler way to use and be able to run the update query.