Oracle INSTR Function Explained

In Oracle, the INSTR function is used to find the first occurrence of a string within another string. Its syntax is as follows:

INSTR(string1, string2, [start_position], [occurrence])

Among them:

  1. string1 is the string to be searched;
  2. string2 is the substring to be searched for;
  3. The start_position is an optional parameter that indicates the starting position for the search, with a default value of 1.
  4. “occurrence is an optional parameter that indicates the number of times the substring to be searched for appears in the string, with a default value of 1.”

The INSTR function will return the position of string2 in string1, or 0 if it cannot be found.

bannerAds