Hi all,
I'm developing an Outsystems Reactive app and I'm getting some "errors" that I don't understand very well. This app is an appointments app to address by every user their most convenient time slot in a date range. For this I have to create some registries in my BBDD (is an Outsystems' native DDBB) with time slots information (DateTime slot data and if it is free for be chosen by user) and I do that creating them in an Outsystems for each loop using some logic like if current date in loop is weekend or if it is inbound hours. This cycle has no problem in its execution and time slots are created properly.
The problem is that app can´t delete all these registries later if App admin wants to choose another date / hours range. I use an SQL sentence to "truncate" all table data but it doesn't do anything and in Outsystems environment I can´t see any error info for this process. It simply stops and no exception is captured.
This is the second approach to the table data truncating problem, before I tried looping through registries and using each ID to delete them one by one with the same result but then I got an ORA-01013 that we think is because some registries were blocked. With SQL approach no ORA error is returned but operation stops and no exception is thrown.
Any clue on what is happening will be appreciated.
Thank you in advance.
Truncate doesn't work due to priviledges. And to delete all the records your approach is fine.
https://success.outsystems.com/documentation/how_to_guides/data/how_to_delete_data_from_entities/
Have in mind that those records you're trying to delete cannot be referenced in another table with Protect rule.
Hi, thank you for your answer,
This is exactly what I did, but it doesn´t work properly. It works first time, but after that it doesn't work anymore. I followed the tutorial you tell me but something strange happens.
Any idea?
What do you mean by "it works first time"? First time you do what? Can you share the code as you did for the creation?
Well this is the funny part. The first time I use the creation code, it works Ok. All time slots are generated and the registries are created properly, but the second time I try to change the date-time range and "old" time slots registries must be deleted, it doesn't happen. The first table delete stops and flow doesn't progress. The tables remains untouched and no error exception is throw.
I share two pictures. The mainFlow one is where slots are created and clearAllDataFlow is where data is deleted from tables at BBDD.
All is OK and working but only first time, after that seems like something happens to BBDD and is like a registries blocking because can't be deleted
Thank you
Truncate is not a supported SQL command. It can never work in OutSystems.
I don't use "truncate" I use "delete"