Data Integration-Free and PayGo
- Data Integration-Free and PayGo
- All Products
sff:instr(str, search, start, occurrence, comparison_type)
Argument
| Required/Optional
| Description
|
---|---|---|
str
| Required
| Passes the value that you want to evaluate.
The string must be a character string. You can enter any valid transformation expression.
The results of the expression must be a character string. Otherwise, instr converts the value to a string before evaluating it.
|
search
| Required
| The set of characters that you want to search for.
You can enter any valid transformation expression. If you want to search for a character string, enclose the characters that you want to search for within single or double quotation marks.
The value must match a part of the string. For example, if you use
instr('Alfred Pope', 'Alfred Smith') the function returns 0.
The value is case sensitive.
|
start
| Optional
| The position in the string where you want to start the search. You can enter any valid transformation expression. The value must be an integer.
The default is 1, meaning that instr starts the search at the first character in the string.
If the start position is 0, instr searches from the first character in the string. If the start position is a positive number, instr locates the start position by counting from the beginning of the string. If the start position is a negative number, instr locates the start position by counting from the end of the string. If you omit this argument, the function uses the default value of 1.
|
occurrence
| Optional
| You can enter any valid transformation expression. If the search value appears more than once in the string, you can specify which occurrence you want to search for. For example, you would enter 2 to search for the second occurrence from the start position.
You can enter a positive integer that is greater than 0.
If you omit this argument, the function uses the default value of 1, which means that instr searches for the first occurrence of the search value. If you pass a decimal value, the function rounds it to the nearest integer value. If you pass a negative integer or 0, the function is not valid.
|
comparison_type
| Optional
| The string comparison type, either linguistic or binary.
Linguistic comparisons take language-specific collation rules into account, while binary comparisons perform bitwise matching. For example, the German sharp s character matches the string “ss” in a linguistic comparison, but not in a binary comparison. Binary comparisons run faster than linguistic comparisons.
You must enter one of the following integer values:
Default is 0.
|
sff:instr( COMPANY, 'a' )
|
|
---|---|
|
|
|
|
|
|
|
|
|
|
sff:instr( COMPANY, 'a', 1, 2 )
|
|
---|---|
|
|
|
|
|
|
|
|
|
|
sff:instr( COMPANY, 'a', -1, 2 )
|
|
---|---|
|
|
|
|
|
|
|
|
|
|
The following table lists some sample values and return values:sff:instr( COMPANY, 'Blue Fin Aqua Center', -1, 1 )
|
|
---|---|
|
|
|
|
|
|
|
|
|
|