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
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.
Discuss challenges in energy and automation with 30,000+ experts and peers.
Find answers in 10,000+ support articles to help solve your product and business challenges.
Find peer based solutions to your questions. Provide answers for fellow community members!