8 Replies Latest reply on Jan 16, 2017 3:03 PM by tdanner

    How do I limit the scope of a query to the current node?

    lll8lll

      I am trying the following:

       

      SELECT CS.RowID as RowID, IsNull(CS.Status, 0) as Value

      FROM Orion.NPM.CustomPollerStatus CS

      INNER JOIN Orion.NPM.CustomPollerAssignment CA ON CA.CustomPollerAssignmentID = CS.CustomPollerAssignmentID

      WHERE (CA.CustomPollerID='E200B54B-C47B-42F7-89C6-5F0784724C0A') AND (CA.NodeID=${N=SwisEntity;M=NodeID})

       

      But I cet an error message: "mismatched input '=' expecting ')' in Where clause"

       

      If I try "AND (CA.NodeID=${NodeId}) the statement is ignored and all rows returned.

       

      If I try the same with SQL:

       

      SELECT CS.RowID as RowID, IsNull(CS.Status, 0) as Value

      FROM CustomPollerStatus CS

      INNER JOIN CustomPollerAssignment CA ON CA.CustomPollerAssignmentID = CS.CustomPollerAssignmentID

      WHERE (CA.CustomPollerID='E200B54B-C47B-42F7-89C6-5F0784724C0A') AND (CA.NodeID=${NodeId})

       

      I get "Query not valid".

      None of the macro vaiants work for either SQL or SWQL queries....