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:  What is difference between SUBSTR and INSTR?


Answer:
SUBSTR returns a specified portion of a string eg SUBSTR('BCDEF',4) output BCDE
INSTR provides character position in which a pattern is found in a string. eg INSTR('ABC-DC-F','-',2) output 7 (2nd occurence of '-')


January 01, 2007 03:49:21 #4
 Rohan Deshpande   Member Since: Visitor    Total Comments: N/A 

RE: What is difference between SUBSTR and INSTR?...
 
SUBSTR: it extracts the string of determined length.whereras (i.e. it returns character for specified position)INSTR:it returns the number of named string.(i.e. it returns number )
     

 

Back To Question