PriorDataLinkDependentsClear: Boolean;
The PriorDataLinkDependentsClear property determines whether objects depending by the contents are pre-cleaned.
Available values:
True. Pre-cleaning is used.
False. Default value. Pre-cleaning is not used.
Executing the example requires that the repository contains two tables with the TABLE_A and TABLE_B identifiers. One of the fields of the TABLE_A table must be external key of any field of the TABLE_B table.
Add a link to the Metabase system assembly.
Sub UserProc;
Var
MB: IMetabase;
Update: IMetabaseUpdate;
Root: IMetabaseUpdateFolderNode;
TableObj: IMetabaseUpdateDataObjectNode;
TableAsKeyObj: IMetabaseUpdateDataObjectNode;
Begin
// Get repository
MB := MetabaseClass.Active;
// Create an update
Update := MB.CreateUpdate;
// Get object containing update structure
Root := Update.RootFolder;
// Add a table with the TABLE_A identifier to update
TableObj := Root.Add(MetabaseUpdateNodeType.DataObject) As IMetabaseUpdateDataObjectNode;
TableObj.Object := MB.ItemById("TABLE_A");
// Update table data and metadata
TableObj.Method := MetabaseUpdateMethod.All;
// Enable object recreation on update
TableObj.AlterType := MetabaseObjectAlterType.Recreate;
// Add a table with the TABLE_B identifier to update
TableAsKeyObj := Root.Add(MetabaseUpdateNodeType.DataObject) As IMetabaseUpdateDataObjectNode;
TableAsKeyObj.Object := MB.ItemById("TABLE_B");
// Update table data and metadata
TableAsKeyObj.Method := MetabaseUpdateMethod.All;
// Sort added objects
Root.Sort(UpdateSortMode.ByDepends);
// Enable object recreation on update
TableAsKeyObj.AlterType := MetabaseObjectAlterType.Recreate;
// Select the Recreate Tables checkbox
Update.AlterType(MetabaseObjectClass.KE_CLASS_TABLE) := MetabaseObjectAlterType.Recreate;
// Apply pre-cleaning of objects depending by the contents
Update.PriorDataLinkDependentsClear := True;
// Save update to file
Update.SaveToFileNF("C:\Update.pefx");
End Sub UserProc;
After executing the example the update with set parameters is saved to file by the specified path.
See also: