Friday, 1 April 2016

SQL Instr

This will allows you for searching through a string for set of characters.

     Syntax: instr (string, search_str [, start_chr_count [, occurrence] ])

     Ex:
          SQL> select instr('information','o',4,1), instr('information','o',4,2) from dual;

INSTR('INFORMATION','O',4,1)          INSTR('INFORMATION','O',4,2)
------------------------------                        -------------------------------------
                           4                                           10

If you are not specifying start_chr_count and occurrence then it will start search from
      the beginning and finds first occurrence only.

If both parameters start_chr_count and occurrence are null, it will display nothing.

No comments:

Post a Comment