Solutions
...
Litmus Production Record Datab...
Interacting with Litmus Produc...
Reading Tag Data Transposed with UTC timestamp
7min
use cases returning tag data recorded by litmus production record database through the use of these select statements can be used for example by any visualization platform which allows to integrate with mssql like; grafana powerbi tableau further can these queries be used by any other application which allows for an odbc connection such as excel c# net python r they can also be part of a larger stored procedure developed by users with t sql by default, litmus production record stores tag items as rows and not individual columns there can be cases where users may want to transpose the default result table to turn tag items into columns for this, litmus production record database provides a prepared way method run s elect query against the table ##transposetagdata after executing the stored procedure prorec tag gettransposedtagdatautc input variables variable name datatype description example @tag varchar(50) the tag name if no specific tag name is to be queried or to get a list of tag name's, the value can also be default which will assume the value % pressure default @device varchar(50) the device name for the tag if no specific device is to be queried or to get a list of devices, the value can also be default which will assume the value % asset1 default @item varchar(50) the item of the tag which the value represents if no specific item is to be queried or to get a list of item's, the value can also be default which will assume the value % value default @tagvalue varchar(256) a specific value for the item of the tag if no specific value for the item is to be queried or to return all values, the value can also be default which will assume the value % 20 default @quality varchar(4) a specific quality of the tag value (good or bad) if no specific quality for the value is to be queried or to return all qualities, the value can also be default which will assume the value % good default @starttime datetime the start of the time period for which to query data the time will be treated as utc if no specific start time is required, the value can also be default which will assume the value null this will trigger the function to calculate a start time of 1h from the current time stamp this means the default time period for which data are returned is always the last hour 2023 03 09 12 57 59 200 default @endtime datetime the end of the time period for which to query data the time will be treated as utc if no specific end time is required, the value can also be default which will assume the value null this will trigger the function to use the current time stamp this means the default time period for which data are returned is always the last hour 2023 03 10 12 57 59 200 default how to use to query transposed tag data, execute the stored procedure prorec tag gettransposedtagdatautc first providing all the required inputs first followed by a select statement against the table ##transposetagdata below is an example using t sql in sql server management studio exec \[le productionrecord] \[dbo] \[ prorec tag gettransposedtagdatautc] select from ##transposetagdata; result the function returns a table as result additional options it is possible to reduce the number of columns returned by the select statement below is an example using t sql in sql server management studio exec \[le productionrecord] \[dbo] \[ prorec tag gettransposedtagdatautc] select tag, value from ##transposetagdata; this will reduce the number of columns returned to only the two selected