IMetabaseUpdate.AlterType

Syntax

AlterType(ClassId: Integer): MetabaseObjectAlterType;

Parameters

ClassId. Repository object type.

Description

The AlterType property determines settings for recreating objects of a specific class on DBMS level.

Comments

To specify repository object type in the ClassId parameter, use the MetabaseObjectClass enumeration.

The property is relevant only for the following object classes: table, stored procedure, view.

Example

Executing the example requires the C:\Update.pefx update file.

Add a link to the Metabase system assembly.

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:\Update.pefx");
End Sub UserProc;

After executing the example a new update is created, for which the following parameters are defined: recreate tables only if object structure changed; always recreate views; never recreate stored procedures.

See also:

IMetabaseUpdate