cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 12

SWQL and PERL using SOAP

Jump to solution

I am using the Perl interface example for the SWQL access.

I am trying to run a query against the Orion.ResponseTime table, here is what the query looks like:


SELECT  NodeID, DateTime, Archive, AvgResponseTime, MinResponseTime, MaxResponseTime, PercentLoss, Availability

FROM Orion.ResponseTime

WHERE NodeID = 28

AND DateTime = (SELECT max(DateTime) as DT

                             FROM Orion.ResponseTime

                          WHERE NodeID = 28 AND Availability < 50)

AND Availability < 50

This Query runs perfectly SWQL Studio, but when I put it into the Perl script and do the call using the $swis->QueryXml( $sql, {} );

It fails completely.  I have narrowed the problem down to the < and > symbols which are passed through SOAP and are translated into &lt; and &gt; when being passed.

                                

I even tried to utilize "BETWEEN 0 AND 50" and but the SWQL does not recognize the BETWEEN command.  I even tried replacing the < and > with LT and GT, and even tried to use &lt and &gt.  I also tried to wrap the sql in     $sql = "<![CDATA[$sql]]>";  with no success.

Does anyone have any other solutions that work? 

Attached is the exact message I am receiving.

Thank you,

Charles

0 Kudos
1 Solution
Level 19

Here's an updated version of InformationService.pm that fixes this issue.

View solution in original post

2 Replies
Level 19

Here's an updated version of InformationService.pm that fixes this issue.

View solution in original post

Thank you very much.  That did the trick. 

I have included a fix for getting a warning for splitqname when $template->type is not defined.