I am interested in saving a group of process variables to a data store, and sele

I am interested in saving a group of process variables to a data store, and selectively deleting rows in that data store, or modifying particular entities in the data store. I have not come upon the correct combination of settings that will allow me to do this using combinations of "Delete from Data Store Entity" or using "Query Database". I seem to be adding to my data store when I try to delete, which is described in the documentation if my index is wrong. I am trying to use a process variable as my index, but its a multiple variable, so it looks like "; 3" if I try to delete the third row in my table. Any quick and simple suggestions on how to modify or delete data in data stores?...

OriginalPostID-62243

OriginalPostID-62243

  Discussion posts and replies are publicly visible

Parents
  • Once you have the CDT set up with a primary key mapping, and you've republished your Data Store, you can try using the Write to DS node to create a row. Save the node output into a PV and check that the "id" field (or whichever field you marked as your PK field) and make sure it has the generated id if you're using @GeneratedValue.

    Then modify the CDT value and call the Write to DS node again, with the id field populated with the id of the row that you want to update. Similarly, use the same id with the Delete from DS node.

    Let us know if you need clarification on any of the above!
Reply
  • Once you have the CDT set up with a primary key mapping, and you've republished your Data Store, you can try using the Write to DS node to create a row. Save the node output into a PV and check that the "id" field (or whichever field you marked as your PK field) and make sure it has the generated id if you're using @GeneratedValue.

    Then modify the CDT value and call the Write to DS node again, with the id field populated with the id of the row that you want to update. Similarly, use the same id with the Delete from DS node.

    Let us know if you need clarification on any of the above!
Children
No Data