UPOS returns a FIXED BIN(31) value which is the index of the nth UTF character in a string.
|
If x has CHARACTER type, then the string must contain valid UTF-8 data. If not, the ERROR condition will be raised.
If x has WIDECHAR type, then the string must contain valid UTF-16 data. If not, the ERROR condition will be raised.
If n is not positive or if n is larger than ULENGTH(x), then zero will be returned. Otherwise, if x has CHARACTER type, then UPOS(x,n) will return the position of the byte where the nth UTF-8 character starts, and if x has WIDECHAR type, then UPOS(x,n) will return the position of the widechar character where the nth UTF-16 character starts.
For example, if x equals the CHARACTER string '4b_c3_a4_66_65_72'x, then