Quantcast
Channel: THWACK: Popular Discussions - Orion SDK
Viewing all articles
Browse latest Browse all 3719

"Complex" SWQL Query and Error

$
0
0

Hi all,

I'm trying to create a table resource for displaying custom poller results using swql query.

 

I've created the query in SQL, where it works without problems. When converted to SWQL though, it produces the error at the bottom of this post.

The query (already translated with SWQL v3 schema names) is:

 

select AP_Name,Switch,Port,Duplex,Speed

from

(   SELECT

    sts.RowID,sts.Status as AP_Name

    FROM

    Orion.NPM.CustomPollerStatus Sts inner join Orion.NPM.CustomPollerAssignment Ass on Sts.CustomPollerAssignmentID = Ass.CustomPollerAssignmentID

    inner join  Orion.NPM.CustomPollers CP on Ass.CustompollerID = CP.CustompollerID

    WHERE

    CP.CustompollerID like '7A4E4DAC-BF2B-4CA4-9DC3-40B6B00C5B5D')as tableAP

left join

(   SELECT

    sts.RowID,sts.Status as Switch

    FROM

    Orion.NPM.CustomPollerStatus Sts inner join Orion.NPM.CustomPollerAssignment Ass on Sts.CustomPollerAssignmentID = Ass.CustomPollerAssignmentID

    inner join  Orion.NPM.CustomPollers CP on Ass.CustompollerID = CP.CustompollerID

    WHERE

    CP.CustompollerID like 'a9f57ac8-efb6-4d8c-97ea-8de315e5c443')as tableSwitch

On tableSwitch.RowID = TableAP.RowID

left join

(   SELECT

    sts.RowID,sts.Status as Port

    FROM

    Orion.NPM.CustomPollerStatus Sts inner join Orion.NPM.CustomPollerAssignment Ass on Sts.CustomPollerAssignmentID = Ass.CustomPollerAssignmentID

    inner join  Orion.NPM.CustomPollers CP on Ass.CustompollerID = CP.CustompollerID

    WHERE

    CP.CustompollerID like '166f2b25-ed1e-41ad-a79b-94f39711753e')as tablePort

 

On TableAP.RowID = Tableport.RowID

 

Left Join

 

(   SELECT

    sts.RowID,sts.Status as Duplex

    FROM

    Orion.NPM.CustomPollerStatus Sts inner join Orion.NPM.CustomPollerAssignment Ass on Sts.CustomPollerAssignmentID = Ass.CustomPollerAssignmentID

    inner join  Orion.NPM.CustomPollers CP on Ass.CustompollerID = CP.CustompollerID

    WHERE

    CP.CustompollerID like '5504e8ad-9cf4-43a1-b2b8-7d4bdcd66c0b')as tableDuplex

 

On TableAP.RowID = TableDuplex.RowID

 

Left Join

 

(   SELECT

    sts.RowID,sts.Status as Speed

    FROM

    Orion.NPM.CustomPollerStatus Sts inner join Orion.NPM.CustomPollerAssignment Ass on Sts.CustomPollerAssignmentID = Ass.CustomPollerAssignmentID

    inner join  Orion.NPM.CustomPollers CP on Ass.CustompollerID = CP.CustompollerID

    WHERE

    CP.CustompollerID like '4d888308-c447-474a-b257-c9b210ad918b')as tableSpeed

 

On TableAP.RowID = TableSpeed.RowID

 

 

Then I will filter the results in order to have details of a single AP in the AP page, but before I would like to have it working in this way.

If I execute all single selects separately, all of them work.

If I execute just the first part (getting the AP name with the external select that gathers from the tableAP) it works.

Apparently what's not working is the join between the various "tables".

 

The error I get is this:

The communication object,

System.ServiceModel.SecuritySessionClientSettings'1+ClientSecurityDuplexSessionChannel[System.ServiceModel.Channels.IDuplexSessionChannel], cannot be used for communication because it is in the faulted state.

 

Any help will be appreciated.

 

Thanks,

Dave

 

 

PS. I also ask if is there a possibility to define a table (like With Table as ( select blablabla) ) in order to avoid multiple joins for every "column" of the query below.


Viewing all articles
Browse latest Browse all 3719

Trending Articles