DELETE operator
The DELETE
operator creates an action that deletes objects.
Syntax
DELETE expr [WHERE whereExpr]
Description
The DELETE
operator creates an action that deletes objects for which a certain condition is met. This operator can add its local parameter, which will correspond to the objects being iterated. In this case, the WHERE
block is mandatory.
Parameters
expr
An expression or typed parameter. You can either use an already declared parameter as a typed parameter, or declare a new local parameter. When using an expression, new local parameters cannot be added.
whereExpr
An expression whose value is for the action being created. If not set, it is considered as equal to
TRUE
.
Examples
// deleting an object
deleteObject(obj) { DELETE obj; }
// deleting all inactive products
CLASS Article;
active = DATA BOOLEAN (Article);
deleteInactiveArticles() {
// a local parameter a is added corresponding to the objects to be iterated over
DELETE Article a WHERE a IS Article AND NOT active(a);
}