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

PowerShell: Correct SQL Select Statement with LIKE

$
0
0

I'm trying to get my PowerShell select statement correct, I can get the correct response with the SWQL, but it does not work for me in the PS script.  I'm sure it's easy, but not sure what I'm missing. 

 

SQL statement that works in SWQL Studio is:

 

SELECT DefinitionID, ContainerID, Expression, Definition

FROM Orion.ContainerMemberDefinition

WHERE ContainerID='23' AND Expression LIKE '%362'

 

Result 140

 

In PowerShell

 

$MemberPrimaryID = '362'

$ContainerID = '23'

 

$definitionID = get-swissdata $swis 'SELECT definitionID from Orion.ContainMemberDefinition Where ContainerID='$ContainerID' AND 'Definition' LIKE '%$MemberPrimaryID'"

 

It runs with no issues, but it does not return a valid value.  With the SQL statement I get 140 as the result with PowerShell I get nothing..


Viewing all articles
Browse latest Browse all 3719

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>