Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Is there a way to clean an entire dataset using the Dataset CRUD tool?

Options

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

Answers

  • williammccusker
    williammccusker Posts: 658 ✭✭✭
    Options

    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.

  • MarcosGuedesPwC
    Options

    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.

  • williammccusker
    williammccusker Posts: 658 ✭✭✭
    Options

    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.

  • MarcosGuedesPwC
    Options

    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

  • MarcosGuedesPwC
    Options

    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?

  • williammccusker
    williammccusker Posts: 658 ✭✭✭
    Options

    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+Responder

  • MarcosGuedesPwC
    Options

    I could solve it, thanks

  • williammccusker
    williammccusker Posts: 658 ✭✭✭
    Options

    Glad I could help!