No, OQL is read-only. So that is not an option.
There are several alternatives, of which creating a java-action is one. Take a look at ObjectHandling’s ‘deleteWithoutEvents’ for inspiration. And use library java.SQL.
Another one is importing a SQL-module. None is available on Marketplace, but maybe you have access to one of your company.
Do make sure your objects have no events and deletion-behavior, because that will get skipped.
Hi Rick,
As far as I know it is not possible to use a delete query in OQL.
You can check it by yourself in the beautiful app : https://service.mendixcloud.com/p/OQL
Where is the application hosted ?
If it is in Mendix cloud , you will not be able to use SQL Script in Java Action, since user name password will not be shared as per the policy.
If OnPremise:
I would suggest to use Database Connector module from Market to execute the queries ( Instead of a Custom Action)
Module : https://marketplace.mendix.com/link/component/2888
My suggestion is to retrieve from Data and Delete in a microflow. Safe and Best one!!
Hope this helps!!