Skip to main content
4-Participant
August 17, 2023
Solved

How to set values as parameters in SQL query. Knowing this values are coming from Kepware.

  • August 17, 2023
  • 1 reply
  • 1653 views

Hello, everyone!

I have this project. Where we have a thing receving values coming from Kepware.

TAG.png

We have to replace this "values" to "text" and display to a mashup
For this reason we have a SQL query bringind all the data in a table.

SQL.png

Questions:

1 - Is possible, somehow bring the (thing values) as input parameters in the SQL query ?

2 - The (thing values) ​​have updates. For this reason, is it possible to do it dynamically?

Let me know if you need more information. I'm not sure if I made it clear enough.

ThankYou in advanced.

 

 

Best answer by Arun_C

Hi @AO_10482328 ,

 

1) We can create Input parameters to SQL Command/Query by "[[VALUE FIELD]]" below image in Thingworx service,

Arun_C_0-1693825832557.png

2) For automatic update of live value, you can call this service to your Remote Thing Subscribtions based on respective live property's Data Change event we can log the data to SQL Database

Arun_C_1-1693826361812.png

 

Note: This method may not be advised because it will hit the database frequently based on live data updates for each parameters due to that data traffic may occurs.

Another suggestion, If you want to display the  live data on mashup means, without doing any external logging you can able to get live property values based on Thingworx default Remote Thing > Services like, You can choose based on requirement.

  • GetPropertyValuesVTQ
  • GetPropertyValuesVTQA
  • GetPropertyValuesAsMultiRowTable

 

Arun_C_2-1693827309993.png

 

Thanks & Regards,

Arun C

1 reply

Arun_C16-PearlAnswer
16-Pearl
September 4, 2023

Hi @AO_10482328 ,

 

1) We can create Input parameters to SQL Command/Query by "[[VALUE FIELD]]" below image in Thingworx service,

Arun_C_0-1693825832557.png

2) For automatic update of live value, you can call this service to your Remote Thing Subscribtions based on respective live property's Data Change event we can log the data to SQL Database

Arun_C_1-1693826361812.png

 

Note: This method may not be advised because it will hit the database frequently based on live data updates for each parameters due to that data traffic may occurs.

Another suggestion, If you want to display the  live data on mashup means, without doing any external logging you can able to get live property values based on Thingworx default Remote Thing > Services like, You can choose based on requirement.

  • GetPropertyValuesVTQ
  • GetPropertyValuesVTQA
  • GetPropertyValuesAsMultiRowTable

 

Arun_C_2-1693827309993.png

 

Thanks & Regards,

Arun C