IMetabaseUpdate.AlterType

Syntax

AlterType(ClassId: Integer): MetabaseObjectAlterType;

Parameters

ClassId - type of repository object. The MetabaseObjectClass enumeration is necessary to use.

Description

The AlterType property determines the case when objects of specified class are created anew on the DBMS level.

Comments

This property is relevant only for the following objects classes: table, stored procedure, view.

Example

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:

IMetabaseUpdate