Is there a way to clean an entire dataset using the Dataset CRUD tool?
I need to clear all the rows of a dataset before filling it with updated data, to keep a reflection of a database. Is there some way to delete all the previous data before starting to add the new rows?
Thanks
Best Answer
-
Hi,
Below is a link to what I could find in the documentation about Criteria Expressions and their syntax. I don't see anything for matching null/not null but perhaps a special string could be used instead? Then the matching case would be something along the lines of
[!="special_token_row"]
Docs on Criteria Expressions
https://docs.parasoft.com/display/VIRT20222/Criteria+Expressions+for+Matching+Values+with+the+Message+Responder0
Answers
-
Hi,
Is this a manual or an automated process? If its manual the desktop can delete a data set which will remove all its row mappings. Or the entire repository could be deleted if it has only a single data set.
0 -
Is an automated process. We need the Dataset rows to be deleted when the virtual asset receives a payload, before updating it with the new values.
0 -
Hi,
The delete action will remove any rows that match, so it might be possible to use either empty correlation criteria and it might match all rows, or put in a correlation with a wild card value so that it would match all rows.
0 -
Greetings,
I could set a wildcard to delete all rows from the data set. But now I have a new issue:
Since the CRUD tool deletes all rows, it disassociates the record type from the data set, and then the process fails to upload the new records with the following message:Source: Data Repository CRUD Tool
Message: Operation: Engagements: The Data Set does not have any record types associated with it.Is there a way to clean the Data Set and keep the Record Type associated to it?
Thanks
0 -
I found a workaround to it.
- Create a null row.
- Delete all rows where the key column is not null.
- Update the Data Set with the new values.
- Delete the null row.
I almost have it solved, but I need to know how to set the delete operation to not use the "all" wildcard [*], but to delete all non-null rows. Is there any fixed or scripted way to do this?
0 -
Hi,
I am not sure if there is an easy criteria expression for 'not null' but could a special key value be used instead? Then an expression like this might work
[!="special_key_value"]
This documentation page has more information about criteria expressions
https://docs.parasoft.com/display/VIRT20222/Criteria+Expressions+for+Matching+Values+with+the+Message+Responder1 -
I could solve it, thanks
0 -
Glad I could help!
0