EcoStruxure Geo SCADA Expert Forum
Schneider Electric support forum about installation, configuration, integration and troubleshooting of EcoStruxure Geo SCADA Expert (ClearSCADA, ViewX, WebX).
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-12-14 06:04 PM . Last Modified: 2023-05-02 11:59 PM
Hi Experts,
I'm looking for adding direct tag reference inside SQL query used in Embedded Lists. The aim is to place the embedded list inside template and instances can have queries 'relative to its area'.
In the below embedded query WHERE condition, can I have a tag/variable reference which is relative? Something like CONCAT(%M(..FullName), '.%') which doesn't work.
SELECT TOP(100)
"RecordId", "SeverityDesc" AS "~SeverityDesc", "RecordTime" AS "~RecordTime", "Source", "Message", "User", "Category", "Foreground", "SeqNo", "CommentNo"
FROM
CDBEVENTJOURNAL
WHERE
"Source" LIKE CONCAT(%M(..FullName), '.%')
Thanks in advance,
Justin
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-12-14 07:13 PM . Last Modified: 2021-12-14 07:13 PM
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-12-14 07:13 PM . Last Modified: 2021-12-14 07:13 PM
You'll need to do this in the animations not the Query tab, set the sql animation to:
'SELECT TOP(100) "RecordId", "SeverityDesc" AS "~SeverityDesc", "RecordTime" AS "~RecordTime", "Source", "Message", "User", "Category", "Foreground", "SeqNo", "CommentNo" FROM CDBEVENTJOURNAL WHERE "Source" LIKE ''' + "..FullName" + '.%'''
The ''' are three single quotes, two of which will be interpreted as a single quote as part of the SQL syntax, and the last quote will be ending the literal string
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-12-14 07:13 PM . Last Modified: 2021-12-14 07:13 PM
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-12-14 07:13 PM . Last Modified: 2021-12-14 07:13 PM
You'll need to do this in the animations not the Query tab, set the sql animation to:
'SELECT TOP(100) "RecordId", "SeverityDesc" AS "~SeverityDesc", "RecordTime" AS "~RecordTime", "Source", "Message", "User", "Category", "Foreground", "SeqNo", "CommentNo" FROM CDBEVENTJOURNAL WHERE "Source" LIKE ''' + "..FullName" + '.%'''
The ''' are three single quotes, two of which will be interpreted as a single quote as part of the SQL syntax, and the last quote will be ending the literal string
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-12-14 07:48 PM
Thanks Adam, that solved the problem.
Link copied. Please paste this link to share this article on your social media post.
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.