The purpose of REPLACE function is to replace one string with another string.
Syntax for REPLACE function
REPLACE (string, find, replace) – The result is a string with the replaced value as given inside of this function. You can learn more SQL Functions for SQL programmer.
- Result is '5555.555.1212'
- Result is '5595551212'
VALUES CHAR (REPLACE ('DINING', 'N', 'VID'), 10)
-Result is 'DIVIDIVIDG'.VALUES
REPLACE ('The quick brown fox', 'QUICK', 'LARGE')
- Result is 'The LARGE brown fox'
Rules for REPLACE
- If the actual length of the replace-string exceeds the maximum for the return data type, an error is returned.
- If any argument can be null, the result can be null; if any argument is null, the result is the null value.