Delete constraint

Previous Next

In the USoft Rule Language, express a DELETE constraint by REMOVE ALL ... FOR WHICH ... :

USoft Rule Language

SQL Equivalent

REMOVE ALL      drivers
FOR WHICH       age < 23

DELETE FROM    driver
WHERE          age < 23

REMOVE ALL      drivers d
FOR WHICH exists
(
   SELECT      ''
   FROM        contract c
   ,           business_party b
   RELATE      b "PAYS FOR" c
   WHERE       b.id = d.id
   AND         c.paid = 'N'
)

DELETE FROM      driver d
WHERE EXISTS
(
   SELECT        ''
   FROM          contract c
   ,             business_party b
   RELATE        b "PAYS FOR" c
   WHERE         b.id = d.id
   AND           c.paid = 'N'
)