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: 2020-09-20 09:25 PM . Last Modified: 2023-05-03 12:10 AM
Hi,
I want to concatenate the fields from a selected row of a data table into a string.
Then display the string in a text on a mimic.
What is the best way to do this?
Is it with SQL, something like the start of below or is there a better way.
Thanks,
Set objectTable = Server.FindObject("PoC.XXXXX.XXXXX.XXXXX.Table.Data")
SelectedRow = Mimic.Layers("New Layer").Item("Lst_1").Current1stColDataStr
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: 2020-09-21 08:47 PM
I'm unsure what your code fragment is meant to represent.
If you're going to write the string to a Text entry on the mimic using the animation property
i.e. Mimic.Layers("Layer").Item("TextItem").Text = "texthere"
Then you most as well do the concatenation within the script.
If you were going to have it within an embedded query list, then you'd have no choice but to have it within the SQL query
ala
SELECT textCol1 || textCol2 || textCol3 as "BigTextCol"
FROM MyTable
It's swings and roundabouts really.
The SQL QP is very efficient at string concatenation, but it's easier to have dynamic concatenation within the script environment for if you add a column etc in the future. You could even have your query as SELECT * FROM MyTable and then have the script enumerate through the columns for those which have 'textCol' in their name, and then concatenating them all at runtime.
This dynamic concatenation is not possible with SQL, you would have to supply the SQL exactly the columns to concatenate ahead of time.
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 forum - and gain access to more than 10,000+ support articles along with insights from experts and peers.