Hi friends,
what is the difference between replace and translate functions?
thanks...............
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Nov 19, 2011, 9:03 AM
Vikas MishraPosted Nov 21, 2011, 4:00 PM
Satyapriya NayakPosted Nov 20, 2011, 6:28 AM
REPLACE replaces every instance of a set of characters with another set of characters; that is, REPLACE works with entire words or patterns.
TRANSLATE replaces single characters at a time, translating the nth character in the match set with the nth character in the replacement set.
REPLACE provides functionality related to that provided by the TRANSLATE function. TRANSLATE provides single-character, one-to-one substitution. REPLACE lets you substitute one string for another as well as to remove character strings.
SQL> select Translate('1tech23', '123', '456') from dual;
Output
-------
4tech56
SQL> select replace('satyam','am','kam') from dual;
Output
-------
satykam
Thanks