Limited support BMC provides limited support for this version of the product. As a result, BMC no longer accepts comments in this space. If you encounter problems with the product version or the space, contact BMC Support.BMC recommends upgrading to the latest version of the product. To see documentation for that version, see BMC AMI Command Center for Db2 13.2

LOCATE function


The LOCATE function returns a large integer indicating the position of one string, searchString, in another, sourceString. The function returns 0 if searchString is a zero-length string or is not found, or if start is greater than the length of sourceString. By default, the search starts at the first character of the receiving string (that is, the value of start is 1), and continues to the end of the string.

LOCATE.png

The arguments are defined as follows:

searchString

searchString is an expression that specifies the string for which you are searching. searchString must return a value that is a built-in single-byte character/varying string data type.

sourceString

sourceString must return a value that is a built-in single-byte character/varying string data type.

start

start is an expression that specifies the position within the searchString where the search is to start. start is expressed in bytes and must return an integer value that is greater than or equal to 1.

Important

If any argument can be null, the result can be null; if any argument value is null, the result is the null value.





 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*