Solutions
...
Litmus Production Record Datab...
Interacting with Litmus Produc...
Inserting Multiple Tag Items if not using Litmus Edge Integration
6min
use cases litmus production record database allows for several ways to insert data into its tables the recommended way when using litmus edge, is to make use of the mssql integrations to insert data directly into the table prorec misc transactions as it allows to make use of the integrated store and forward capability, preventing data loss on a connection interruption but for cases, where this is not an option, a stored procedure can be called by a program or code snippet to insert data data any application which provided the capability to use an odbc connection can be used like python c# net excel go java method execute stored procedure prorec misc writeintotransactiontables input variables variable name datatype description example @deviceid varchar(8000) pipe symbol "|" separated list of device names associated with each tag asset1|asset2|asset3 @registerid varchar(8000) pipe symbol "|" separated list of tag names temperature|pressure|speed @tagname varchar(8000) pipe symbol "|" separated list of data items for the tag value|alarm|5min average @datatype varchar(8000) pipe symbol "|" separated list of timestamps in unix millisecond format enclosed by "##" > this is also used to distinguish between a production record item and a tag ##1678279064681## | ##1678279064682## | ##1678279064681## @value varchar(8000) pipe symbol "|" separated list of values for each tag 45|high|780 @success varchar(8000) pipe symbol "|" separated list of quality of each tag (1 = good, 0 = bad) 1|1|0 how to use to insert a multiple value(s) for tag item(s), call the stored procedure prorec misc writeintotransactiontables using the t sql exec or execute keyword and provide the input variables below is an example using t sql in sql server management studio exec \[le productionrecord] \[dbo] \[prorec misc writeintotransactiontables] @deviceid = n' asset1|asset2|asset3 ', @registerid = n' temperature|pressure|speed ', @tagname = n' value|alarm|5min average ', @datatype = n' ##1678279064681## | ##1678279064682## | ##1678279064681## ', @value = n' 45|high|780 ', @success = n' 1|1|0 '; result the stored procedure will verify that the provided values are correctly formatted and then write them into the table prorec prorec transactions this will trigger their immediate processing the result can be read back from the log table prorec tag log below is an example using t sql in sql server management studio select top (100) \[logid] ,\[logtype] ,\[logprocedure] ,\[logentry] ,\[logtime] from \[le productionrecord] \[dbo] \[prorec tag log] order by logid desc; with the result returned messages returned by the stored procedure message meaning example which triggers one or more parameters are null, please provide the correct values for each parameter one or more of the input variables have no value provided exec \[le productionrecord] \[dbo] \[prorec misc writeintotransactiontables] one of the provided deviceid is invalid the value is either the devicename for tags or a comma separated list of the node and optional levelnames for at least one value for the input variable @deviceid a unique identifier such as "07045de1 5ac1 4e12 b8f5 608efc9c23c2" was provided exec \[le productionrecord] \[dbo] \[prorec misc writeintotransactiontables] @deviceid = n' 07045de1 5ac1 4e12 b8f5 608efc9c23c2 |asset2|asset3 ', @registerid = n' temperature|pressure|speed ', @tagname = n' value|alarm|5min average ', @datatype = n' ##1678279064681## | ##1678279064682## | ##1678279064681## ', @value = n' 45|high|780 ', @success = n' 1|1|0 ' one of the provided registerid is invalid the value is either the tagname for tags or a comma separated list of the identifiers for at least one value for the input variable @registerid a unique identifier such as "07045de1 5ac1 4e12 b8f5 608efc9c23c2" was provided exec \[le productionrecord] \[dbo] \[prorec misc writeintotransactiontables] @deviceid = n' asset1|asset2|asset3 ', @registerid = n' 07045de1 5ac1 4e12 b8f5 608efc9c23c2 |pressure|speed ', @tagname = n' value|alarm|5min average ', @datatype = n' ##1678279064681## | ##1678279064682## | ##1678279064681## ', @value = n' 45|high|780 ', @success = n' 1|1|0 '