This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Did SWQL subqueries break in npm 12.2?

All,

Did SWQL subqueries change in NPM 12.2?  I recently upgraded and noticed I had some reports not working.  This looks for sites that dont have some devices in them.  But its not returning the List of sites that it should:

Select NC.City

FROM Orion.NodesCustomProperties NC

WHERE City NOT IN (

SELECT

NC.City

FROM Orion.Nodes 

INNER JOIN Orion.NodesCustomProperties NC ON (Nodes.NodeID = NC.NodeID)

WHERE (Nodes.MachineType LIKE '%36%')

AND (Nodes.Status <> '2')

)

  • Are you seeing this in SWQL Studio, Reporting, or somewhere else?

  • I see it in both SWQL and a report using SWQL.  However when I run the subquery it returns results and then when I run the whole query I get no results.  This report worked a few days ago before I upgraded to NPM 12.2.

  • I have tried to play with the query reported, executed the subquery in "NOT IN" operand as well as the whole query, inspected its processing and I have not found any suspicious behavior. The queries are sent to SQL directly in semantically equivalent form. Not really sure what the issue is. I also haven't found any difference in a query processing in NPM 12.2.

    You say that the query is supposed to return a list of sites that don't have "some" devices in them. The subquery obviously returns a list of cities that have devices meeting criteria in the WHERE clause. The whole query then actually makes a diff between all cities present and cities with the "some" devices. Please excuse my question, but are you sure that there were any other cities left that were not covered by a subquery? (The criteria is also volatile due to the Status property test.)

  • So for some reason I checked this report a few day later and it is working again.  Weird.  As you said perhaps a field hadnt been updated yet.  thanks for checking and sorry I had not written back sooner, got busy on another fire fighting mission.  thanks again