Welcome to the new Schneider Electric Community

It's your place to connect with experts and peers, get continuous support, and share knowledge.

  • Explore the new navigation for even easier access to your community.
  • Bookmark and use our new, easy-to-remember address (community.se.com).
  • Get ready for more content and an improved experience.

Contact SchneiderCommunity.Support@se.com if you have any questions.

Close
Invite a Co-worker
Send a co-worker an invite to the Exchange portal.Just enter their email address and we’ll connect them to register. After joining, they will belong to the same company.
Send Invite Cancel
84649members
353989posts

Concatenate the fields from a selected row of a data table into a string

EcoStruxure Geo SCADA Expert Forum

Find out how SCADA systems and networks, like EcoStruxure Geo SCADA Expert, help industrial organizations maintaining efficiency, processing data for smarter decision making with IoT, RTU and PLC devices.

DavidSkilbeck
Lt. Commander
Lt. Commander
0 Likes
1
508

Concatenate the fields from a selected row of a data table into a string

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

 

Tags (1)
1 Reply 1
BevanWeiss
Spock
Spock
0 Likes
0
472

Re: Concatenate the fields from a selected row of a data table into a string

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.


Lead Control Systems Engineer for Alliance Automation (VIC).
All opinions are my own and do not represent the opinions or policies of my employer, or of my cat..
Tags (1)