REPLACE AND TRANSLATE:
REPLACE
|
TRANSLATE |
Replace
functions searches for a string and replaces with the given string |
Replace
functions searches for a character and its replaces in the occurrences of the
character |
Replace
lets you substitute one string for another string |
Translate
function provides single character one to one substitution |
REPLACE:
Example: 1
Output:
Explanation:
‘ab’ is the replacement string, so where
the ‘ab’ string is located its replaced into 12.
Example: 2
Output:
Explanation:
If we don’t give any replacement value
replace function consider as NULL value.
Above example, ‘ab’ is the string
replaced into null value.
Translate:
Example: 1
Output:
Explanation:
Here, ‘a’ replacement value is 1 and ‘b’
replacement value is 2 so its perform character like conversion.
Example: 2
Output:
Explanation:
Here, the complete string replaced into
NULL.
Example: 3
If we use without Third argument it shows error,
Report will be,
Your blog is awfully appealing. I am contented with your post. I regularly read your blog and its very helpful. If you are looking for the best Oracle 12c Dba Course, then visit Akswave. Thanks! I enjoyed this blog post.
ReplyDelete