i would like to find and replace string in json.
Example json:
{
"app": {
"value": "ff5aeb05-7a22-46fd"
},
"name": {
"value": "John"
},
"surname": {
"value": "Smith"
}
}
Only replace “John” or “Smith” to something “XYZ”. Looking for the value of e.g. name. Then replace word after: “value”: “John” to “value”: “XYZ”
This is my proposal but i would like the solution to be generic.
SELECT regexp_replace('{"app":{"value":"ff5aeb05-7a22-46fd"},"name":{"value":"John"},"surname":{"value":"Smith"}}','John','XYZ')
FROM DUAL