Transaction group 'insert changed rows' causes extra rows because of 'store timestamp to' action

Transaction group stores daily acumulated values at the end of each day. one of the block items is a PLC date. To help with error checking, i also selected the ‘store timestamp to’ option in the action tab so i can store the system timestamp to another table column in the event the plc time sync functions we use do not work and plc time ends up being incorrect.

I am also using the ‘insert changed rows’ action because this is an array of data from the PLC so we don’t loose data if we miss an insert.

What is happening….. The array is 10 rows for daily inserts. the data does not change but becuase the timestamp changes, the transaction group inserts 10 rows every day resulting in duplicated data along with the one row that is updated for that particular daily insert.

How do i get this transaction group to insert the timestamp but only insert rows for the data that changes in the array from the plc?

Transaction groups cannot ignore a column as you desire.

Consider replacing the entire transaction group with a suitably parameterized script with named queries or "prep" queries.

ok. perhaps i’ll update the table at the DB level so that timestamp column has a default value of the current timestamp obtained from that server instead of a timestamp inserted by ignition. that way i get my timestamp when ignition does the insert through the transaction group.

Thanks for your clarification

1 Like