SQL/MX 2.x Reference Manual (H06.04+)

SQL/MX Functions and Expressions
HP NonStop SQL/MX Reference Manual540440-003
9-72
Examples of LOCATE
Examples of LOCATE
Return the value 8 for the position of the substring ‘John’ within the string:
LOCATE ('John','Robert John Smith')
Suppose that the EMPLOYEE table has an EMPNAME column that contains both
the first and last names. This SELECT statement returns all records in table
EMPLOYEE that contain the substring 'SMITH', regardless of whether the column
value is in uppercase or lowercase characters:
SELECT * FROM persnl.employee
WHERE LOCATE ('SMITH',UCASE(empname)) > 0 ;