43429members
217967posts

[Imported] Relative References in Embedded Lists Query Tab

Highlighted
Sisko

[Imported] Relative References in Embedded Lists Query Tab

>>Message imported from previous forum - Category:Scripts and Tips<<
User: mchartrand, originally posted: 2018-10-25 18:56:39 Id:272
This is a re-posting from the obsoleted (October 2018) "Schneider Electric Telemetry & SCADA" forum.

_______

**_Chadam:
Hi Guys,
Do embedded lists support relative references? I will like to search for Points in the Current Folder with the text "Run" in the Fullname.
My WHERE syntax doesn't appear correct._**

_SELECT
"FullName" AS "~FullName", "Id", "Foreground", "Blink", "Background", "CurrentStateDesc", "CurrentQualityDesc"
FROM
CDBPOINT
WHERE
"FullName" LIKE '..Fullname.%Run%'
ORDER BY
"~FullName" ASC_

___________________________

aneeskp:

Hi Chadam,

Relative references can done through animations of List.

Double click the list and click animations. Now in the sql property enter the following:

'SELECT "FullName" AS "~FullName", "Id", "Foreground", "Blink", "Background", "CurrentStateDesc", "CurrentQualityDesc" FROM CDBPOINT WHERE Fullname Like ''' + ".FullName" +'.%Run%'' ORDER BY "~FullName" ASC'

You can view the populated query with actual value of the relatively refered fullname in the Query tab.

Not sure if there's any other workaround, ideally this should work

 

Cheers ! 🙂

________________________

dmercer:
A little trick that I find useful when doing this, is to break up the lines in the animation expression by putting the + at the end of each line. It makes it much more readable when you have to make long queries in an animation.

 

aneeskp's query could become:

_'SELECT "FullName" AS "~FullName", "Id", "Foreground", "Blink", "Background", "CurrentStateDesc", "CurrentQualityDesc" ' +
'FROM CDBPOINT ' +
'WHERE Fullname Like ''' + ".FullName" +'.%Run%'' ' +
'ORDER BY "~FullName" ASC'_

___________________________

**_Chadam:
You guys are legends. Works like a charm. Thanks for the quick responses._**