<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Finding Row number in SQL select results in Active IQ Unified Manager Discussions</title>
    <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Finding-Row-number-in-SQL-select-results/m-p/126506#M22730</link>
    <description>&lt;P&gt;&lt;a href="https://community.netapp.com/t5/user/viewprofilepage/user-id/42752"&gt;@KevHaynes&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for bringing this unique case. This might be a bug with WFA, mysql User defined variables are not working User-Input queries. I don't know the root cause as yet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to see if a workaround can get this through. I'll get you updated on this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sinhaa&lt;/P&gt;</description>
    <pubDate>Thu, 22 Dec 2016 16:43:05 GMT</pubDate>
    <dc:creator>sinhaa</dc:creator>
    <dc:date>2016-12-22T16:43:05Z</dc:date>
    <item>
      <title>Finding Row number in SQL select results</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Finding-Row-number-in-SQL-select-results/m-p/126435#M22710</link>
      <description>&lt;P&gt;Right, I have a scenario where I have a schedule, say daily_0000, and later in the workflow I want to use that named schedule to find the next schedule in sequence, so daily_0005. My thought was to return the number of the schedule in my list, and then add one to it, then return the name. Now I have mySQL Workbench installed on the WFA server and have used the below to return the output with a list of numbers to be used as an index.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;BR /&gt;SET @row=0;

SELECT
@row:=@row+1 as num,
    schedule.name,
    cluster.primary_address AS 'cluster.primary_address'
FROM
    cm_storage.schedule,
    cm_storage.cluster
WHERE
    cluster.id = schedule.cluster_id
    AND  substring(schedule.name,1,11) =substring('daily_0000',1,11)
    AND  cluster.name = 'cluster1'

ORDER BY
    schedule.name&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which returns the below...&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; daily_0000 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cluster1&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; daily_0005 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cluster1&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; daily_0010 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cluster1&lt;/P&gt;&lt;P&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; daily_0015 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cluster1&lt;/P&gt;&lt;P&gt;5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; daily_0020 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cluster1&lt;/P&gt;&lt;P&gt;...etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I transfer the above code into WFA, it complains that the syntax is wrong. Can you not use @variables in WFA SQL lookups? If not can anyone think of a way for me to achieve what im after?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 18:04:22 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Finding-Row-number-in-SQL-select-results/m-p/126435#M22710</guid>
      <dc:creator>KevHaynes</dc:creator>
      <dc:date>2025-06-04T18:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Row number in SQL select results</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Finding-Row-number-in-SQL-select-results/m-p/126437#M22712</link>
      <description>&lt;P&gt;&lt;a href="https://community.netapp.com/t5/user/viewprofilepage/user-id/42752"&gt;@KevHaynes&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You might be able to break your workflow up and utilize the&amp;nbsp;row repetition feature of WFA. Index and loop counts can be handled there. I do something similar with all nodes in a cluster&amp;nbsp;during an SVM create workflow to create data LIF's on each node.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the goal of the workflow?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Lawrence&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 18:59:37 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Finding-Row-number-in-SQL-select-results/m-p/126437#M22712</guid>
      <dc:creator>lawrencg</dc:creator>
      <dc:date>2016-12-20T18:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Row number in SQL select results</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Finding-Row-number-in-SQL-select-results/m-p/126459#M22721</link>
      <description>&lt;P&gt;The goal is...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Create&amp;nbsp; a volume&lt;/P&gt;&lt;P&gt;Set the Snapshot Policy&lt;/P&gt;&lt;P&gt;Create the destination volume&lt;/P&gt;&lt;P&gt;Create the mirror&lt;/P&gt;&lt;P&gt;Set the Snapmirror Update to happen 5 minutes after the snapshot (our schedules set a nightly, and a weekly).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hence wanting to search on one schedule, but return the next. I did contemplate an MVEL function for a while, but figured this way would be easier.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2016 09:29:41 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Finding-Row-number-in-SQL-select-results/m-p/126459#M22721</guid>
      <dc:creator>KevHaynes</dc:creator>
      <dc:date>2016-12-21T09:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Row number in SQL select results</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Finding-Row-number-in-SQL-select-results/m-p/126506#M22730</link>
      <description>&lt;P&gt;&lt;a href="https://community.netapp.com/t5/user/viewprofilepage/user-id/42752"&gt;@KevHaynes&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for bringing this unique case. This might be a bug with WFA, mysql User defined variables are not working User-Input queries. I don't know the root cause as yet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to see if a workaround can get this through. I'll get you updated on this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sinhaa&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2016 16:43:05 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Finding-Row-number-in-SQL-select-results/m-p/126506#M22730</guid>
      <dc:creator>sinhaa</dc:creator>
      <dc:date>2016-12-22T16:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Row number in SQL select results</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Finding-Row-number-in-SQL-select-results/m-p/126508#M22731</link>
      <description>&lt;P&gt;&lt;a href="https://community.netapp.com/t5/user/viewprofilepage/user-id/42752"&gt;@KevHaynes&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are still a few things that are slightly unlcear to me. You want to use&amp;nbsp;&lt;SPAN&gt;daily_0000 for snapshot creation and daily_0005 for the SnapMirror updates?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pending the SQL variable workaround that&amp;nbsp;&lt;a href="https://community.netapp.com/t5/user/viewprofilepage/user-id/9704"&gt;@sinhaa&lt;/a&gt;&amp;nbsp;might find, could the policy staggering be done a little differently to make the WFA logic simpler? The soultion below decouples schedule name from the schedule interval. (Assuming daily_0020 runs at 12:20am, daily_0005 runs at 12:05am&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have implemented&amp;nbsp;something similar that included 100's of volumes per node.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="s1"&gt;SnapMirror relationship.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;Prod&lt;/STRONG&gt; &amp;nbsp; &amp;nbsp;—DP&lt;SPAN&gt;—&lt;/SPAN&gt;&amp;gt; &amp;nbsp; &lt;STRONG&gt;&amp;nbsp;DR&lt;/STRONG&gt; &amp;nbsp; &amp;nbsp;—XDP&lt;SPAN&gt;—&lt;/SPAN&gt;&amp;gt; &amp;nbsp;&lt;STRONG&gt; &amp;nbsp;Archive&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN class="s1"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Our requirement:&lt;/P&gt;&lt;P&gt;1. 15 min snapshots on source volumes.&lt;/P&gt;&lt;P&gt;2. 15 min SnapMirror updates to DR.&lt;/P&gt;&lt;P&gt;3. 15 min SnapVault update from DR to Archive.&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Prod&amp;nbsp;for snapshot creation will be:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&amp;nbsp; (job schedule cron show)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN&gt;15min_snapshot_with_mirror_&lt;/SPAN&gt;01 &amp;nbsp; &amp;nbsp; @:10,:25,:40,:55&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN&gt;15min_snapshot_with_mirror_&lt;/SPAN&gt;02 &amp;nbsp; &amp;nbsp; @:13,:28,:43,:58&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;15min_snapshot_with_mirror_03 &amp;nbsp; &amp;nbsp; @:01,:16,:31,:46&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN&gt;15min_snapshot_with_mirror_&lt;/SPAN&gt;04 &amp;nbsp; &amp;nbsp; @:04,:19,:34,:49&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN&gt;15min_snapshot_with_mirror_&lt;/SPAN&gt;05 &amp;nbsp; &amp;nbsp; @:07,:22,:37,:52&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;DR for SnapMirror updates will be:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&amp;nbsp; (job schedule cron show)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;15min_mirror_01 &amp;nbsp; &amp;nbsp; @:01,:16,:31,:46&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;15min_mirror_02 &amp;nbsp; &amp;nbsp; @:04,:19,:34,:49&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;15min_mirror_03 &amp;nbsp; &amp;nbsp; @:07,:22,:37,:52&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;15min_mirror_04 &amp;nbsp; &amp;nbsp; @:10,:25,:40,:55&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;15min_mirror_05 &amp;nbsp; &amp;nbsp; @:13,:28,:43,:58&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Archive&lt;SPAN&gt; for SnapMirror updates &lt;/SPAN&gt;will be:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&amp;nbsp; (job schedule cron show)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;15min_mirror_01&amp;nbsp; &amp;nbsp; @:10,:25,:40,:55&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;15min_mirror_02 &amp;nbsp; &amp;nbsp; @:13,:28,:43,:58&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;15min_mirror_03 &amp;nbsp; &amp;nbsp; @:01,:16,:31,:46&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;15min_mirror_04 &amp;nbsp; &amp;nbsp; @:04,:19,:34,:49&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;15min_mirror_05 &amp;nbsp; &amp;nbsp; @:07,:22,:37,:52&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;In our case, we manage each Prod-&amp;gt;DR-&amp;gt;Archive relationship as a set and all relationships will have the same schdule name on all clusters. A clean schedule for relationships end-to-end is the key. You might need more policies if clusters&amp;nbsp;have both Prod and DR data for each other.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Example:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;vol_0001_p - Snapshot Schedule -&lt;SPAN&gt;15min_snapshot_with_mirror_03&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN&gt;vol_0001_d - SnapMirror Schedule -&amp;nbsp;15min_mirror_03&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&lt;SPAN&gt;vol_0001_a -&amp;nbsp;SnapMirror Schedule -&amp;nbsp;15min_mirror_03&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;If one goal is to staggar the Snapshot loads on clusters and SnapMirror network throughput, in WFA, you can choose the correct policy to apply by getting volume counts for each policy on Prod and use the one with the lowest count. You could then use an MVEL function to get the "03" part of the Prod policy to use when applying the SnapMirror policy. &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;snapmirror-policy = "15_min_mirror_"+getSMRelationshipNumber("&lt;SPAN&gt;15min_snap_with_mirror_&lt;/SPAN&gt;&lt;SPAN&gt;01")&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2016 18:23:26 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Finding-Row-number-in-SQL-select-results/m-p/126508#M22731</guid>
      <dc:creator>lawrencg</dc:creator>
      <dc:date>2016-12-22T18:23:26Z</dc:date>
    </item>
  </channel>
</rss>

