Hi,
i'm obviously quite new to this, but do understand the instr function more generally, its just the 'position' variable that's confusing me a bit, and both the oracle documentation and the fundamentals exam guide are quite vague on it.
The INSTR(source string, search item, [start position],[nth occurrence of search
item) function returns a number that represents the position in the source string,
beginning from the given start position, where the nth occurrence of the search item
begins
Examples
Example 7-127 Using Character Position to Search Forward to Find the Position of a Substring
The following example searches the string "Corporate Floor",
beginning with the third character, for the string "or". It returns the position in "Corporate Floor" at which the second occurrence of "or" begins.
SHOW INSTR('Corporate Floor','or', 3, 2)
14
surely these two things are just untrue?
if the search began from the given start position in the example taken from oracle docs, the answer would be 12, not 14? from character 3 ('r') to the second instance of 'or' is 12 characters inclusive, isn't it?
or have i completely misunderstood?
thanks,
Nick
Edited by: 967660 on 25-Oct-2012 06:55
Edited by: 967660 on 25-Oct-2012 06:56