Active IQ Unified Manager Discussions

query search case insensitive

berhei
2,890 Views

Hello (again)

 

if you use a query as userinput you can search the list "as you type". Is there a way to make this search case insensitive?

 

Best regards

berhei

1 ACCEPTED SOLUTION

trentino123
2,877 Views

sure, if you are talking about a query in SQL. my suggestion is bring to lowercase your user input and also the data you are looking for.

 

this is an example  AND LOWER(igroup.name) LIKE LOWER('%${vmware_cluster}%')  :

 

SELECT
    DISTINCT aggregate.name AS 'name',
    vserver.name AS 'vserver.name',
    cluster.primary_address AS 'node.cluster.primary_address' ,
    node.name AS 'node.name',
    cluster.id AS 'cluster.id'
FROM
    cm_storage.vserver vserver,
    cm_storage.igroup igroup,
    cm_storage.cluster cluster,
    cm_storage.aggregate,
    cm_storage.node
WHERE
    igroup.vserver_id = vserver.id
    AND LOWER(igroup.name) LIKE LOWER('%${vmware_cluster}%')

    AND vserver.is_repository IS NOT TRUE
    AND (
        vserver.type = 'cluster'
        OR vserver.type = 'data'
    )
    AND vserver.cluster_id = node.cluster_id
    AND node.cluster_id = cluster.id
    AND aggregate.name NOT LIKE '%aggr0%'

View solution in original post

1 REPLY 1

trentino123
2,878 Views

sure, if you are talking about a query in SQL. my suggestion is bring to lowercase your user input and also the data you are looking for.

 

this is an example  AND LOWER(igroup.name) LIKE LOWER('%${vmware_cluster}%')  :

 

SELECT
    DISTINCT aggregate.name AS 'name',
    vserver.name AS 'vserver.name',
    cluster.primary_address AS 'node.cluster.primary_address' ,
    node.name AS 'node.name',
    cluster.id AS 'cluster.id'
FROM
    cm_storage.vserver vserver,
    cm_storage.igroup igroup,
    cm_storage.cluster cluster,
    cm_storage.aggregate,
    cm_storage.node
WHERE
    igroup.vserver_id = vserver.id
    AND LOWER(igroup.name) LIKE LOWER('%${vmware_cluster}%')

    AND vserver.is_repository IS NOT TRUE
    AND (
        vserver.type = 'cluster'
        OR vserver.type = 'data'
    )
    AND vserver.cluster_id = node.cluster_id
    AND node.cluster_id = cluster.id
    AND aggregate.name NOT LIKE '%aggr0%'

Public