Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Community
Community
Notifications
close
  • Forums
  • Knowledge Center
  • Events & Webinars
  • Ideas
  • Blogs
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register
Sustainability
Sustainability

We Value Your Feedback!
Could you please spare a few minutes to share your thoughts on Cloud Connected vs On-Premise Services. Your feedback can help us shape the future of services.
Learn more about the survey or Click here to Launch the survey
Schneider Electric Services Innovation Team!

geoSCADA Expert SQL Query WHERE clause referencing a string variable in the database

EcoStruxure Geo SCADA Expert Forum

Schneider Electric support forum about installation, configuration, integration and troubleshooting of EcoStruxure Geo SCADA Expert (ClearSCADA, ViewX, WebX).

cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Home
  • Schneider Electric Community
  • Remote Operations
  • EcoStruxure Geo SCADA Expert Forum
  • geoSCADA Expert SQL Query WHERE clause referencing a string variable in the database
Options
  • Mark Topic as New
  • Mark Topic as Read
  • Float this Topic for Current User
  • Bookmark
  • Subscribe
  • Mute
  • Printer Friendly Page
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close
Top Experts
User Count
sbeadle
Kirk sbeadle Kirk
309
AndrewScott
Admiral AndrewScott
99
BevanWeiss
Spock BevanWeiss
91
AdamWoodlandToo
Lt. Commander AdamWoodlandToo
38
View All
Related Products
product field
Schneider Electric
EcoStruxure™ Geo SCADA Expert

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
Back to EcoStruxure Geo SCADA Expert Forum
GwalkerGCCC
Crewman GwalkerGCCC
Crewman

Posted: ‎2023-11-23 05:59 PM

0 Likes
1
671
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2023-11-23 05:59 PM

geoSCADA Expert SQL Query WHERE clause referencing a string variable in the database

The below SQL query joins tables CENETANALOG and CENETBINARY, and filters per site, in this case MRWTP (%MRWTP%), and also filters alarms that are 'SeverityType' = 2 and the relevant limits and descriptions.

What I want to know is, can I reference a string variable, eg, (%<reference string variable from database>%) which could be changed by inputting into a text box, which changes the string variable, and there by changes the query to that specific site, which updates the list.

SQL Query

 

( SELECT
CENETANALOG.OBJECTLINK, CENETANALOG.FULLNAME, CENETANALOG.ALARMDISABLED, CENETANALOG.CURRENTVALUEFORMATTED, NULL AS STATE0SEVERITYTYPE, NULL AS STATE0SEVERITY, NULL AS STATE0DESC, NULL AS STATE1SEVERITYTYPE, NULL AS STATE1SEVERITY, NULL AS STATE1DESC, CENETANALOG.HIGH1SEVERITYTYPE, CENETANALOG.HIGH1SEVERITY, CENETANALOG.HIGH1LIMITSTD, CENETANALOG.HIGH1DESC, CENETANALOG.HIGH2SEVERITYTYPE, CENETANALOG.HIGH2SEVERITY, CENETANALOG.HIGH2LIMITSTD, CENETANALOG.HIGH2DESC, CENETANALOG.HIGH3SEVERITYTYPE, CENETANALOG.HIGH3SEVERITY, CENETANALOG.HIGH3LIMITSTD, CENETANALOG.HIGH3DESC, CENETANALOG.HIGH4SEVERITYTYPE, CENETANALOG.HIGH4SEVERITY, CENETANALOG.HIGH4LIMITSTD, CENETANALOG.HIGH4DESC, CENETANALOG.LOW1SEVERITYTYPE, CENETANALOG.LOW1SEVERITY, CENETANALOG.LOW1LIMITSTD, CENETANALOG.LOW1DESC, CENETANALOG.LOW2SEVERITYTYPE, CENETANALOG.LOW2SEVERITY, CENETANALOG.LOW2LIMITSTD, CENETANALOG.LOW2DESC, CENETANALOG.LOW3SEVERITYTYPE, CENETANALOG.LOW3SEVERITY, CENETANALOG.LOW3LIMITSTD, CENETANALOG.LOW3DESC, CENETANALOG.LOW4SEVERITYTYPE, CENETANALOG.LOW4SEVERITY, CENETANALOG.LOW4LIMITSTD, CENETANALOG.LOW4DESC
FROM
CENETANALOG
WHERE
( "FullName" LIKE '%MRWTP%' ) AND ( ( CENETANALOG.HIGH1SEVERITYTYPE = 2 ) OR ( CENETANALOG.HIGH2SEVERITYTYPE = 2 ) OR ( CENETANALOG.HIGH3SEVERITYTYPE = 2 ) OR ( CENETANALOG.HIGH4SEVERITYTYPE = 2 ) OR ( CENETANALOG.LOW1SEVERITYTYPE = 2 ) OR ( CENETANALOG.LOW2SEVERITYTYPE = 2 ) OR ( CENETANALOG.LOW3SEVERITYTYPE = 2 ) OR ( CENETANALOG.LOW4SEVERITYTYPE = 2 ) ) )
UNION
( SELECT
CENETBINARY.OBJECTLINK, CENETBINARY.FULLNAME, CENETBINARY.ALARMDISABLED, CENETBINARY.CURRENTVALUEFORMATTED, CENETBINARY.STATE0SEVERITYTYPE, CENETBINARY.STATE0SEVERITY, CENETBINARY.STATE0DESC, CENETBINARY.STATE1SEVERITYTYPE, CENETBINARY.STATE1SEVERITY, CENETBINARY.STATE1DESC, NULL AS EMPTY3, NULL AS EMPTY4, NULL AS EMPTY5, NULL AS EMPTY6, NULL AS EMPTY7, NULL AS EMPTY8, NULL AS EMPTY9, NULL AS EMPTY10, NULL AS EMPTY11, NULL AS EMPTY12, NULL AS EMPTY13, NULL AS EMPTY14, NULL AS EMPTY15, NULL AS EMPTY16, NULL AS EMPTY17, NULL AS EMPTY18, NULL AS EMPTY19, NULL AS EMPTY20, NULL AS EMPTY21, NULL AS EMPTY22, NULL AS EMPTY23, NULL AS EMPTY24, NULL AS EMPTY25, NULL AS EMPTY26, NULL AS EMPTY27, NULL AS EMPTY28, NULL AS EMPTY29, NULL AS EMPTY30, NULL AS EMPTY31, NULL AS EMPTY32, NULL AS EMPTY33, NULL AS EMPTY34
FROM
CENETBINARY
WHERE
( "FullName" LIKE '%MRWTP%' ) AND ( ( "State1SeverityType" = 2 ) OR ( "State0SeverityType" = 2 ) ) )

 

 

Thank you !

Labels
  • Labels:
  • DNP3
  • Logic
  • SCADA
  • ViewX
  • Tags:
  • english
  • scada
  • SCADA app
  • SCADA software
  • SCADA tutorial
  • Telemetry and SCADA
Reply

Link copied. Please paste this link to share this article on your social media post.

  • All forum topics
  • Previous Topic
  • Next Topic
Reply 1
rlao
Lt. Commander rlao
Lt. Commander

Posted: ‎2023-12-07 10:28 PM

0 Likes
0
610
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2023-12-07 10:28 PM

You can create an embedded list object and then store your SQL query as a string which you can concatenate to your string variable. This will update your embedded list based off the value of your variable.

 

See here for how to convert your SQL query to a mimic animation expression string.

 

See here for how to tie your SQL expression string to a database field/object such as a string variable value.

Reply

Link copied. Please paste this link to share this article on your social media post.

Preview Exit Preview

never-displayed

You must be signed in to add attachments

never-displayed

 
To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support
Brand-Logo
Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

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.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings © 2025 Schneider Electric

This is a heading

With achievable small steps, users progress and continually feel satisfaction in task accomplishment.

Usetiful Onboarding Checklist remembers the progress of every user, allowing them to take bite-sized journeys and continue where they left.

of