3 Replies Latest reply: Oct 3, 2013 10:37 AM by MPERIYAK RSS

simple query help needed

MPERIYAK Sprinter
Currently Being Moderated

I am new to this and need some basic help on a query.

 

All I need is, the list of vfiler names and the corresponding Array IP's to be populated in the first column

I then choose a vFiler and array IP from the list and it lists all the corresponding volumes on that vFiler

 

This is not sufficient

 

SELECT

    vfiler.name

FROM

    storage.vfiler

WHERE

    (

        vfiler.name <> "vfiler0"

}

 

and secondly

 

select

    storage.volume.name,

storage.volume.size_mb

 

from

storage.vfiler,

storage.volume,

storage.array

 

where

    storage.array.ip = '${PrimaryArrayIP}'

 

group by

    storage.volume.name

  • Re: simple query help needed
    jakob_scheidler Certified Novice
    Currently Being Moderated

    Hey,

     

    something like this? Actually I would use three select fields mostly because it looks nicer in my eyes. Like filer -> vfiler -> volumes. Problem is, if you can't be sure that there are never duplicate vfiler names you will need the filer for selecting the volumes.

     

    SELECT

    CONCAT(vfiler.name,'  -  ',array.ip)

    FROM

    storage.vfiler

    JOIN storage.array ON vfiler.array_id = array.id

    WHERE vfiler.name NOT LIKE 'vfiler0'

     

    SELECT

    volume.name

    volume.size_mb

    FROM

    storage.volume

    JOIN storage.vfiler ON volume.vfiler_id = vfiler.id

    JOIN storage.array ON volume.array_id = array.id

    WHERE vfiler.name LIKE TRIM(SUBSTRING_INDEX('${ResultOfFirstQuery}','-',1))

    AND array.ip LIKE TRIM(SUBSTRING_INDEX('${ResultOfFirstQuery}','-',-1))

     

    Regards

    • Re: simple query help needed
      shailaja NetApp Employee Cyclist
      Currently Being Moderated

      Hi,

       

      Even I would agree that having three inputs like the above mentioned by Jakob would be nice. If you are fine with that, you can look at the queries used in the sample workflow named "Create a Qtree CIFS share in a vFiler"

      There are queries that list the filers, the vfilers in the selected filer and finally the volumes of the selected vFiler.

       

      vfiler_queries.png

       

      Thanks,

      Shailaja

  • Re: simple query help needed
    MPERIYAK Sprinter
    Currently Being Moderated

    Thanks to both. Your suggestions helped me.

More Like This

  • Retrieving data ...

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points