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!

[Imported] Embedded SQL Statement Within ST Query

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
  • [Imported] Embedded SQL Statement Within ST Query
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
sbeadle
Kirk sbeadle Kirk
Kirk

Posted: ‎2019-11-05 12:50 PM . Last Modified: ‎2023-05-03 12:36 AM

0 Likes
0
636
  • 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: ‎2019-11-05 12:50 PM . Last Modified: ‎2023-05-03 12:36 AM

[Imported] Embedded SQL Statement Within ST Query

>>Message imported from previous forum - Category:ClearSCADA Software<<
User: florian, originally posted: 2018-10-24 21:06:14 Id:205
This is a re-posting from the obsoleted (October 2018) "Schneider Electric Telemetry & SCADA" forum.

---------------

**_NIWTelemetry:_**
**_Hello, Looking for some assistance._**

**_I am trying to develop a Structured Text logic program to_**

**_1 identify analogue points related to certain geographic areas by SQL query_**

**_2 disable the alarms on those points via a Method_**

**_grateful for any assitance or examples to get me started. I imagine there is a Type / End_Type block at the top of the ST with a SQL statement producing a record set then a DO statement looping through the record set calling the method._**

**_Thanks_**

-----

AWoodland:
You'll need two logic programs chained together.

The first logic program has the %S in with the query to get the list of the FullName that you're interested in, loop through the returned data and call the execute method on the second logic program. The second logic program (execute on interval, with interval of 0) takes the fullname as an input parameter, uses that input to define the method, i.e. Something AT %M({FullName}.Method); and then call that method.

The first level program would execute once, the second level one would execute multiple times all triggered from the first one (depending on how many points to process you may need to increase the max queue size on the second logic program).

Depending on how you want to control the geographic reason you can pass that in as an input to the first logic program

--------------

bevanweiss:
I think this would be possible with just one query.

_TYPE_
_AlarmObject : DATABASE_OBJECT(CAlarmObject)_
_DisableAlarms : METHOD (DINT);_
_END_TYPE;_

_PROGRAM HereLayDragons_

_VAR NOCACHE_
_MyObjects AT %S(SELECT O.Id FROM CAlarmObject O WHERE O.GEOPosition WITHIN (SELECT R.GeoRegion FROM _CGISRegion R WHERE R.FullName = 'MyRegion')) : RESULTSET OF AlarmObject;_
_END_VAR;_

_WHILE MyObjects.Valid DO_
_MyObjects.Value.DisableAlarms(0);_
_END_WHILE;_

_END_PROGRAM;_


Note: This code is untested.. and also there's this warning...
UNEXPECTED EQUIPMENT OPERATION

ClearSCADA is not suitable for controlling safety-critical systems and must not be used unilaterally to do so. ClearSCADA is not tested for, nor has any approval for use in, the control of safety-critical systems. Safety-critical systems should be controlled by an approved safety-critical platform that is installed independently of ClearSCADA.

The configuration of this product requires expertise in the design, configuration and programming of SCADA control systems. Only persons with such experience should be allowed to configure ClearSCADA. Only persons with the appropriate programming experience should be allowed to write any scripts, Logic programs, expressions, or SQL queries intended for use in ClearSCADA.

Failure to follow these instructions can result in death, serious injury, or equipment damage.

------------------------

**_NIWTelemetry:_**
**_Thank you - very useful!_**

----------------


**_NIWTelemetry:_**
**_Thank you all for your comments!_**

Labels
  • Labels:
  • SCADA
Reply
Contact Support

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

  • All forum topics
  • Previous Topic
  • Next Topic
Replies 0
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