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 '-')


February 02, 2006 08:01:33 #2
 srinivas22338   Member Since: February 2006    Total Comments: 1 

RE: What is difference between SUBSTR and INSTR?...
 

substr gives the substring of the position we gives where as

instr gives the the character present in the particular position

     

 

Back To Question