Case in-sensitive user search

Version 1
    This document was generated from CDN thread

    Created by: Matthew Gibson on 19-11-2013 01:03:06 PM
    I have created a query to search end-users within CUCM via AXL. It works successfully (searching at the moment on first name), providing the correct combination of upper and lower case letters is provided e.g. Matt will return user Matt, but the search string MATT will not return Matt. Is there any way to submit a string which ignores case sensitivity? Ideally I would like to submit, for example, m%, and have it return all users which have a first name starting with either m or M.


    Subject: RE: Case in-sensitive user search
    Replied by: Thomas Ellis on 27-11-2013 08:32:08 AM
    Hey Matt.  I haven't tried this within the AXL context, but try using the executeSQLQuery function and supply the following query:
    SELECT * FROM enduser WHERE LOWER(CAST(firstname AS varchar)) LIKE 'm%'

    not sure if the CAST is needed because I don't know for sure the datatype of the 'firstname' column.  Basically, the LOWER function in SQL will convert all the column values to lowercase to perform the search.  It works in SQL, but I'm not sure how AXL will handle that when translating.  It's worth a shot.


    Subject: RE: Case in-sensitive user search
    Replied by: Matthew Gibson on 27-11-2013 09:49:14 AM
    Thanks for your response Thomas. I've just tried it and it works perfectly!