AlterType(ClassId: Integer): MetabaseObjectAlterType;
ClassId - type of repository object. The MetabaseObjectClass enumeration is necessary to use.
The AlterType property determines the case when objects of specified class are created anew on the DBMS level.
This property is relevant only for the following objects classes: table, stored procedure, view.
Sub UserProc;
Var
Mb: IMetabase;
U: IMetabaseUpdate;
N, N2,N3 : IMetabaseUpdateObjectNode;
Begin
Mb:= MetabaseClass.Active;
U:= Mb.CreateUpdate;
U.AlterType(MetabaseObjectClass.KE_CLASS_TABLE):= MetabaseObjectAlterType.Default_;
U.AlterType(MetabaseObjectClass.KE_CLASS_VIEW):= MetabaseObjectAlterType.Recreate;
U.AlterType(MetabaseObjectClass.KE_CLASS_PROCEDURE):= MetabaseObjectAlterType.Restrict;
N:= U.RootFolder.Add(MetabaseUpdateNodeType.Object) As IMetabaseUpdateObjectNode;
N.Object := Mb.ItemById("TABLE");
N2:= u.RootFolder.Add(MetabaseUpdateNodeType.Object) As IMetabaseUpdateObjectNode;
N2.Object := Mb.ItemById("PROC");
N3:= U.RootFolder.Add(MetabaseUpdateNodeType.Object) As IMetabaseUpdateObjectNode;
N3.Object := Mb.ItemById("VIEW");
U.SaveToFileNF("c:\temp\Update1.pefx");
End Sub UserProc;
After executing the example a new update, for which the following parameters are defined: to recreate tables, only if object structure changed; always to recreate views; never to recreate the stored procedures - is created.
See also: