This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
dev:sql:orafunctions:instr [2010/07/06 19:53] tdo |
— (current) | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | {{page>:top_add&nofooter&noeditbtn}} | ||
| - | <html><div align="center"><span style="color:red">DRAFT</span></div></html> | ||
| - | ====== Omnidex SQL Function: INSTR ====== | ||
| - | {{page>:sql_bar&nofooter&noeditbtn}} | ||
| - | | [[ dev:sql:orafunctions:chr | CHR ]] | [[ dev:sql:orafunctions:instr | INSTR ]] | [[ dev:sql:orafunctions:new_time | NEW_TIME ]] | [[ dev:sql:orafunctions:nvl | NVL ]] | [[ dev:sql:orafunctions:substr | SUBSTR ]] | [[ dev:sql:orafunctions:sys_extract_utc | SYS_EXTRACT_UTC ]] | [[ dev:sql:orafunctions:sysdate | SYSDATE ]] | [[ dev:sql:orafunctions:systimestamp | SYSTIMESTAMP ]] | [[ dev:sql:orafunctions:to_date | TO_DATE ]] | [[ dev:sql:orafunctions:to_number | TO_NUMBER ]] | | ||
| - | ===== 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. | ||