syntax plsql functions plsql 10g, 9i, guide
 

SQL Function Oracle Function instr


In oracle pl sql error functions, the instr function returns the location of a substring in a string.

The syntax for the instr Oracle function is:

instr( string1, string2, [ start_position ], [ nth_appearance ] )

string1 is the string to search.

string2 is the substring to search for in string1.

start_position is the position in string1 where the search will start. This argument is optional. If omitted, it defaults to 1. The first position in the string is 1. If the start_position is negative, the function counts back start_position number of characters from the end of string1 and then searches towards the beginning of string1.

nth_appearance is the nth appearance of string2. This is optional. If omitted, it defaults to 1.

Note: If string2 is not found in string1, then the instr Oracle function will return 0.

 
 

Examples using Oracle Function instr sintax function

For example:

instr('Merovingio', 'e') would return 2; the first occurrence of 'e'
instr('Merovingio', 'e', 1, 1) would return 2; the first occurrence of 'e'
instr('Merovingio', 'e', 1, 2) would return 11; the second occurrence of 'e'
instr('Merovingio', 'e', 1, 3) would return 14; the third occurrence of 'e'
instr('Merovingio', 'e', -3, 2) would return 2.
 
 
Oracle news Oracle guide
     
  29-11-2006 Guida Oracle 10g
     
  30-02-2007 Oracle Server
     
  29-02-2007 Oracle Errors
Functions Oracle Functions
Delete Delete
Between Between
Check Check
Count Count
Datatypes Datatypes
Delete Oracle Delete Statement
Distinct Distinct
Exists Exists
Functions Functions
Grant revoke Grant Revoke
Group by Oracle Group by
Having Having
Oracle Function in Oracle Function in
Indexes Indexes
Insert Insert
Intersect Intersect
Isnull Is null
Joins Joins
Installation Oracle 10g Substr
Oracle guide Oracle to_number
Installation Oracle 10g Substr
 
Oracle Functions PLSQL  l Consulenza Software Verona  l  Siti Web Verona  l   Exceptions  l  Oracle Errors  l  Oracle Collaborations Suite  l  Products  l  Contact
Oracle guide