Deleting all rows using delete from data store entity

Hi,

I am trying to delete all the existing rows from the data entity using delete from data store entity smart service. Can anyone please suggest me what to include in identifiers if we want to delete everything without specifying all the identifiers?

Thanks

Yeswanth.

  Discussion posts and replies are publicly visible

Parents
  • Hi ,

    I found a way to delete multiple records in Appian. Below is steps for same:

    1. Create a process model 

    2. Refer attached image for Process Model

    3. Process Model logic: pass 1 input parameter to PP, and then configure delete operation, post increment unique PP value using script task, then check using OR that if PP value is max unique value in table, and accordingly again assign to delete

    4. Run process model in debug mode

    5. It will empty all records 

Reply
  • Hi ,

    I found a way to delete multiple records in Appian. Below is steps for same:

    1. Create a process model 

    2. Refer attached image for Process Model

    3. Process Model logic: pass 1 input parameter to PP, and then configure delete operation, post increment unique PP value using script task, then check using OR that if PP value is max unique value in table, and accordingly again assign to delete

    4. Run process model in debug mode

    5. It will empty all records 

Children
  • 0
    Certified Lead Developer
    in reply to Anurag

    You are aware that looping in a process model is NOT a best practice and will get you into trouble when you try to empty a table with a million rows?

  • Hi Stefan,

    Thanks for pointing out that point Slight smile

    The option given by me is only it can be used when handling few (say less than 100 records) records. I had given the solution considering while developing new Application in Appian we usually generate test data which we need to delete to test again functionality. And many times developer dont have database access so they can consider this option.

    Now for point where we need to delete million records:

    1. First of all if it is required to delete records in such huge count, user should prefer taking backup of existing table and perform truncate operation (as delete will make your database slow)

    2. Even using stored procedures which we call from Application i wont suggest, as it will impact Application Performance

    3. If records count is in million, i would suggest to perform any operation directly using Oracle SQL Developer, MYSQL Server etc and not by app code.

    Above points i have mentioned considering my previous experience. Also with appian, i currently have less than a month of experience...so there could be also other options available which i am yet to find.

    Always up for any new ideas/suggestions Slight smile