Determines how a delete should be affected by the existence of child-file records that relate to the record being deleted
Type: Property
Access: Read/Write
Data Type: Boolean
Parameters:
None
Syntax
Property Boolean Cascade_Delete_State
Get Cascade_Delete_State to BooleanVariable |
Set Cascade_Delete_State to BooleanVariable/Value |
Description
Set Cascade_Delete_State to True
Cascade_Delete_State specifies how a delete should be affected by the existence of child table records that relate to the record being deleted.
If Cascade_Delete_State is True, then the child records and all descendant records will be deleted. You can add additional child validation code in Validate_Cascade_Delete. Also see Validate_Delete for more information.
If the property is False, the delete will only be allowed if no child records exist.
Both methods ensure that child table records will never become orphan records.
Using CascadeDeleteAllowed in a child table DD (DataDictionary) allows any child table to determine if it will allow itself to be deleted as part of a cascade delete.
CascadeDeleteNull allows child DDs to specify if they should be deleted or have their child to parent relationship set to null.
Note: | If child records are being deleted and the child table does not have an index to jump into that starts with the related parent columns, the records will be deleted in RowId or Recnum order, which means that each record has to be loaded and read; this could take an exceedingly long time to process. |
See Also
Defining Data Dictionary Table Attributes