locate(search_string, source_string)
and locate(search_string, source_string, start_index)
to a function or expression that can be used at the data source. If the default implementation is used, a function name of LOCATE will be used for the function name.
If the default implementation is used, the expression will not be modified if:
locate(search_string, source_string)
is usedlocate(search_string, source_string, start_index)
is used and start_index
is a literal integer greater then 0If the default implementation is used, the expression will be modified if:
locate(search_string, source_string, start_index)
is used and start_index
is a literal integer less then 1locate(search_string, source_string, start_index)
is used and start_index
is not a literal integerIf the default implementation is used and the expression is modified, it is modified to ensure that any literal integer value less than 1 is made equal to 1 and any non literal value is wrapped by a searched case expression to ensure that a value of less then 1 will be equal to 1 and the parameter order matches that of what the data source expects.
For example:
locate('a', 'abcdef')
--> LOCATE('a', 'abcdef')
locate('a', 'abcdef', 2)
--> LOCATE('a', 'abcdef', 2)
locate('a', 'abcdef', 0)
--> LOCATE('a', 'abcdef', 1)
locate('a', 'abcdef', intCol)
--> LOCATE('a', 'abcdef', CASE WHEN intCol < 1 THEN 1 ELSE intCol END)
|
|
|
|
|
|