Difference Between Replace and Translate

Difference Between Replace and Translate :- 


--====================================================
--Difference between replace and Translate
--====================================================

SYNTAX:-  Replace ( STRING , FIND_STRING, REPLACE_WITH )

select Replace('Ram is good boy','o','1') from dual
Result: Ram is g11d b1y


select Replace('Ram is good boy','O','1') from dual
Result: Ram is good boy


select Replace('Ram is good boy','oo','1111') from dual
Result: Ram is g1111d boy
  

select Replace('Ram is good boy','oo',' ') from dual
Result: Ram is g d boy

--====================================================
SYNTAX:- translate('Ram is good boy','od','12') 

select translate('Ram is good boy','o','1') from dual
Result: Ram is g11d b1y


select translate('Ram is good boy','oo','12') from dual
Result: Ram is g11d b1y


select translate('Ram is good boy','good','123') from dual
Result: Ram is 122 b2y


select translate('manoj kumar hello world delho','manoj','12345') from dual
Result: 12345 ku12r hell4 w4rld delh4


select TRANSLATE('1tech23', '123', '456') FROM DUAL
Result: '4tech56'


select TRANSLATE('222tech', '2ec', '3it')  FROM DUAL
Result: '333tith'

Comments

Popular posts from this blog

E-Text Report In Fusion | Types of E-Text reports

Supplier API's

How to pass default Parameter in cursor