Switch to: V12V11V10V9V8V7V6V5

Action ON DELETE

The ONE DELETE Action specifies what should happens with Child-records when you delete a parent record. With help of this you can control Referential Integrity of your database, thereby enforcing business rules at the database level

When you try DELETE a parent record this raise question: what should happens with its child records? The answer gives the ON DELETE Action of a Link.

Foreign Key and ObjectPtr

You can specify one of the following constants:

  • RESTRICT (default). Means that DELETE of parent record is refused if at least one child record exists.
  • CASCADE - means that all child records are deleted also.
  • SET NULL - means that value of PTR field is set to NULL, i.e. a child record still exists, but do not have parent record.
  • SET DEFAULT - means that value of PTR field is set to its default value, i.e. it looks like the child record gets a new parent record.

ObjectPtr

You can specify one of the following constants:

  • RESTRICT (default). Means that DELETE of parent record is refused if at least one child record exists.
  • CASCADE - means that all child records are deleted also.
  • SET NULL - means that value of PTR field is set to NULL, i.e. a child record still exists, but do not have parent record.

You can specify one of the following constants:

  • RESTRICT - (default), means that DELETE of parent record is refused if at least one child record exists.
  • CASCADE - means that all child records are deleted also.
You can use this action for binary link of 1:M kind. For symmetric links of 1:1 and M:M kind this can be used only if VLink.Owner is specified.