How to Delete the data in a Outsystems entity

How to Delete the data in a Outsystems entity

  
Hello everyone,

I have a question, about deleting all data of a outsystems entity.
How is that possible ? , do you have examples for me please ?

Kind regards,


Kadir Karapinar
Hi Kadir, 

the easiest way is doing an advanced query with "delete from {your_entity}"

Cheers, 
Ricardo.
Ricardo Araújo wrote:
Hi Kadir, 

the easiest way is doing an advanced query with "delete from {your_entity}"

Cheers, 
Ricardo.
 
 delete * from {Link_NewsItem_Category}

I will do something like this, but i get an yellow warning "Unexpected '*' in SQL statement of AdvQuery1
You can also use the DBMaintenance E-space we've created internally to rigorously drop entire database tables. :)

Seems like you included a "*" sign in your advanced query that isn't expected.
Mind you that the notification might be a warning only and may not have any effect on the actual execution of the statement.

Besides that if you want to actually execute the advanced query delete statement that you put in a ; after the statement followed by a commit;.
You'll get an error that the environment lost 'connection' to the transaction but the statement would irrevokably be executed.
Also either maintain the "On delete cascade" structure within the entities or delete any other entities referencing the table as mandatory.
Kadir Karapinar wrote:
 
 delete * from {Link_NewsItem_Category}
 
 Hi Kadir,

That is because the delete syntax does have a * ...
Notice that in Ricardo reply there was no * there. Remove it and will work.


Regards,
João Rosado