replace
Replaces all occurrences of the old string in the str string with the new string and returns the replaced string. If no overlapping string is found, the original str is returned.
Syntax
replace(string <str>, string <old>, string <new>)
Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| str | Yes | STRING | The string to be replaced. |
| old | Yes | STRING | The string to be compared. |
| new | Yes | STRING | The replacement string. |
Return Values
Returns a value of type STRING.
If any input parameter is NULL, NULL is returned.
Example Code
Returns AA123AA.
SELECT replace('abc123abc', 'abc', 'AA'); Returns NULL.
SELECT replace('abc123abc', null, 'AA'); What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot