Example of XML index usage by predicates with case-insensitive comparisons

In XML, string comparisons are case-sensitive. However, some applications might require case-insensitive comparisons. You can use the fn:upper-case function to do a case-insensitive comparison.

Example: The following query retrieves all XML documents from the INFO column of the CUSTOMER table for customers whose child address has a street whose upper-case is “BAILEY AVE”. The query will return the XML document, when the street is “Bailey Ave”, or “bailey ave”, or “Bailey AVE”, and so on.

SELECT INFO FROM CUSTOMER
 WHERE XMLEXISTS('$x/customerinfo/address[fn:upper-case(street) = 
 "BAILEY AVE"]'   
 PASSING CUSTOMER.INFO AS "x")

The following index can be used for the predicate:

CREATE INDEX CUST_STREET_UPPER on CUSTOMER(INFO)
 GENERATE KEY USING XMLPATTERN '/customerinfo/address/street/fn:upper-case(.)'
 AS VARCHAR(50)