AlterAndSave;
The AlterAndSave method creates or updates system tables of time series database.
Executing the example requires that the repository contains a database with the OBJ_DB identifier and an MDM repository with the MDM_REPO identifier.
Sub Main;
Var
Mb: IMetabase;
Inf: IMetabaseObjectCreateInfo;
Obj: IMetabaseObjectDescriptor;
Cat: IRubricator;
Rds: IRdsDatabase;
Database: IDatabase;
Begin
Mb := MetabaseClass.Active;
Inf := Mb.CreateCreateInfo;
Inf.Id := "OBJ_FC_EX";
Inf.Name := Inf.Id;
Inf.ClassId := MetabaseObjectClass.KE_CLASS_RUBRICATOR;
Inf.Parent := Mb.Root;
Inf.KeepEdit := True;
Obj := Mb.CreateObject(Inf);
Cat := (Obj As IRubricator);
Rds := Mb.ItemById("RDS_REPO").Bind As IRdsDatabase;
Cat.Database := Rds;
Database := Mb.ItemById("OBJ_DB").Bind As IDatabase;
Cat.DatabaseEx := Database;
Cat.CreateFacts;
Cat.AutoUnits := True;
Cat.CalendarLevels := DimCalendarLevelSet.Year Or DimCalendarLevelSet.Quarter;
Cat.AlterAndSave;
End Sub Main;
After executing the example the OBJ_FC_EX time series database with all its system tables is created in the repository. The system tables are located in the database.
See also: