Solutions
...
Litmus Production Record Datab...
Interacting with Litmus Produc...
Inserting Multiple Production Record Item 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 comma separated lists consisting of node name and optional level names testarea,level1name,level2name|testarea,level1name,level2name,level3name|testarea,level1name,level2name @registerid varchar(8000) pipe symbol "|" separated list of comma separated lists of identifier item names identifieritem1,identifieritem2|identifieritem1,identifieritem2,identifieritem3|identifieritem1,identifieritem2 @tagname varchar(8000) pipe symbol "|" separated list of item name eventitem1|eventitem2| identifieritem1 @datatype varchar(8000) pipe symbol "|" separated list of c omma separated lists of values for the identifiers provided in @registerid 1,100|asset1,shift1,line2|1,100 @value varchar(8000) pipe symbol "|" separated list of values for the item specified by @tagname 12|shutdown|1 @success varchar(8000) pipe symbol "|" separated list of definition if the item is an identifier? (1 = no, 0 = yes) 1|1|0 how to use to insert multiple values for production record 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' testarea,level1name,level2name|testarea,level1name,level2name,level3name|testarea,level1name,level2name ', @registerid = n' identifieritem1,identifieritem2|identifieritem1,identifieritem2,identifieritem3|identifieritem1,identifieritem2 ', @tagname = n' eventitem1|eventitem2| identifieritem1 ', @datatype = n' 1,100|asset1,shift1,line2|1,100 ', @value = n' 12|shutdown|1 ', @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 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 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 |testarea,level1name,level2name,level3name|testarea,level1name,level2name ', @registerid = n'identifieritem1,identifieritem2|identifieritem1,identifieritem2,identifieritem3|identifieritem1,identifieritem2', @tagname = n'eventitem1|eventitem2|identifieritem1', @datatype = n'1,100|asset1,shift1,line2|1,100', @value = n'12|shutdown|1', @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'testarea,level1name,level2name|testarea,level1name,level2name,level3name|testarea,level1name,level2name ', @registerid = n' 07045de1 5ac1 4e12 b8f5 608efc9c23c2 | identifieritem1,identifieritem2,identifieritem3|identifieritem1,identifieritem2', @tagname = n'eventitem1|eventitem2|identifieritem1', @datatype = n'1,100|asset1,shift1,line2|1,100', @value = n'12|shutdown|1', @success = n'1|1|0'