NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform. You will still be able to view content, but posting and replying will be temporarily disabled.
We're excited to launch our new Community experience on July 30 and more information will follow soon.
Stay connected during the transition - Join our Discord community today.

Active IQ Unified Manager Discussions

query search case insensitive

berhei
3,467 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
3,454 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
3,455 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