GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Oracle  >  SQL

 Print  |  
Question:  Replace and Translate

Answer: How and in what way REPLACE is different from TRANSLATE?


October 10, 2009 02:22:05 #7
 Rabindra_Kumar   Member Since: October 2009    Total Comments: 6 

RE: Replace and Translate
 
Replace and Translate both works with three argument

replace(arg1,arg2,arg3)
translate(arg1,arg2,arg3)

the inbuilt function "Replace" replace the arg2 with arg3. it replaces the whole strig.
while the inbuilt function "Translate" replace the each caharacter of arg2 with the corresponding character of argument 3.

if write down the following query


SELECT Translate('Ramesh Kumar Jha','Ramesh','Mukesh') FROM dual;

Result would be

Mukesh Kukur Jhu
     

 

Back To Question