The lastIndexOf() method is part of the JDK (Java Development Kit) that comes with ASA. Unlike ASA's own CHARINDEX() function, lastIndexOf() finds the position of the last occurrence of a search string inside another string. This example shows how lastIndexOf() can be called directly from a Watcom SQL script run via DBISQL. It displays "test: last_index = 4" on the ASA server console. Note that Java starts counting at 0 when it comes to character positions in strings.