Solutions
...
Litmus Production Record Datab...
Interacting with Litmus Produc...
Inserting Production Record Item if not using Litmus Edge Integration via JSON
6min
note this feature requires litmus production record database v 1 4 0 0 or higher 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 using a json object as input input variables variable name datatype description example @jsoninput varchar(8000) a single json object which has to always include the keys deviceid > comma separated lists consisting of node name and optional level names registerid > comma separated lists of identifier item names tagname > holds the item name datatype > c omma separated lists of values for the identifiers provided in @registerid value > value for the item specified by @tagname success > definition if the item is an identifier? (1 = no, 0 = yes) or an array of json objects for multiple inserts \[{"deviceid" "energymonitoringdevice dtdl","registerid" "dt instance,asset","tagname" "asset","datatype" "edm l3 machine1,123","value" "123","success"\ true},{"deviceid" "energymonitoringdevice dtdl","registerid" "dt instance,asset","tagname" "dt instance","datatype" "edm l3 machine1,123","value" "edm l3 machine1","success"\ true},,{"deviceid" "energymonitoringdevice dtdl,telemetry,power","registerid" "dt instance,asset","tagname" "value","datatype" "edm l3 machine1,123","value" "52 524841352846764","success"\ false},{"deviceid" "energymonitoringdevice dtdl,telemetry,power","registerid" "dt instance,asset","tagname" "timestamp","datatype" "edm l3 machine1,123","value" "1694688519848","success"\ false}] how to use to insert a value(s) for production record item(s) via json, call the stored procedure prorec misc writeintotransactiontables using the t sql exec or execute keyword and provide the input variable below is an example using t sql in sql server management studio exec \[le productionrecord] \[dbo] \[prorec misc writeintotransactiontables] @jsoninput = n' \[{"deviceid" "energymonitoringdevice dtdl","registerid" "dt instance,asset","tagname" "asset","datatype" "edm l3 machine1,123","value" "123","success"\ true},{"deviceid" "energymonitoringdevice dtdl","registerid" "dt instance,asset","tagname" "dt instance","datatype" "edm l3 machine1,123","value" "edm l3 machine1","success"\ true},,{"deviceid" "energymonitoringdevice dtdl,telemetry,power","registerid" "dt instance,asset","tagname" "value","datatype" "edm l3 machine1,123","value" "52 524841352846764","success"\ false},{"deviceid" "energymonitoringdevice dtdl,telemetry,power","registerid" "dt instance,asset","tagname" "timestamp","datatype" "edm l3 machine1,123","value" "1694688519848","success"\ false}] '; 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 prorec 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 prorec log] order by logid desc; with the result returned for more detailed logging, enable the "debug log" option for verbose logging as described in reading out the application configuration of litmus production record database docid\ evlxiglsvxjkjcqsgf2pp and modify application configuration items docid\ nizz5qavwknlczz51008q