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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Nov 19, 2011, 4:03 AM EST
Satyapriya NayakRank #47 · 31.5K reputationPosted Nov 20, 2011, 1:28 AM EST
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
Vikas MishraRank #559 · 4.3K reputationPosted Nov 21, 2011, 11:00 AM EST