top_add_nofooter_noeditbtn

DRAFT

Omnidex SQL Function: INSTR

Description

The INSTR function returns an integer value representing the starting position of a string within the search string.

This function is only available when the CREATE ENVIRONMENT statement contains the SQL_SYNTAX ORACLE clause or the SET SQL_SYNTAX ORACLE setting is set programmatically.

Syntax

Syntax: INSTR(target_string, search_string[, start_position[, occurrence]])

Discussion

target_string

Target_string is a character expression of either a column_spec or a collection of functions that return a string.

search_string

Search_string is a character expression of either a column_spec or a collection of functions that return a string.

start_position

Start_position is an optional integer expression that indicates that the all characters previous to the start_position should be ignored.

occurrence

Occurrence is an optional integer expression that indicates to return character position of the nth occurrence of the search_string.

Examples

 select instr('12345','3') from $omnidex;

Returns a value of 3

select instr('1234512345','3',4) from $omnidex;

Returns a value of 8.

 select instr('1234512345','3',1,2) from $omnidex;

Returns a value of 8.

 
Back to top
dev/sql/functions/instr.txt ยท Last modified: 2016/06/28 22:38 (external edit)