Hello,
We are using Data Store Entities Smart to delete all data from a table. Problem is that id have to be provided of what have to be deleted. And if the number of thoose id's is bigger the services does not work. Is there a way to delete all the records inside table ? Or to delete them by other identification which is not the primary key. For example delete all records which have column name "status" = 2.
This way we will achieve the deletion of big portions of data. Or the other option is truncate table if it is available ?
Discussion posts and replies are publicly visible
You can do it by creating a stored procedure that include query to be executed and run that stored procedure from Appian wherever required. This way you will have no limitation on input value length and you can provide multiple input to filter in procedure like status=2 etc.
Hey, Chitra I have also the similar use case, but if I execute the stored procedure, then I have to sync the record also. Is there any other way where Sync in not required.
No. When you manipulate the DB skipping Appian and record related functions, you need to trigger a sync to make Appian aware of the changes.
I was about suggest him use "Delete Records" .But, If data is large we might have to go for Looping .Is there any possible drawbacks of using Delete Records in a loop Stefan??
Thanks , Actually I have a use case to truncate around 40 tables on weekly basis. So Is there any way I can do this through Appian record to avoid sync.
You could just not use a synced record. Do you need any of the features only supported by synced records?
https://docs.appian.com/suite/help/23.4/Sync_Records_Smart_Service.html#syncing-data-deletions
But , There is difference in Delete and truncate. Deletion will not refresh the primary Key, instead it continues from last Id.