IView.AlterView

Syntax

AlterView(OldView: IView);

Parameters

OldView is the view, structure of which should be updated according to the structure of current procedure.

Description

The AlterView method updates the structure of OldView view on DB server according to the structure of current view.

Example

Sub UserProc;
Var
    MB: IMetabase;
    View, OldView: IView;
Begin
    Mb := MetaBaseClass.Active;
    View := Mb.ItemById("View_1").Edit As IView; //view, which structure will be used for update
    OldView := Mb.ItemById("View_2").Bind As IView; //view, which structure on database server will be updated
    View.NativeName := OldView.NativeName; //set equal physical names temporarily.
    //It is required for saving uniqueness of physical name of OldView view
    View.AlterView(OldView);
End Sub UserProc;

After executing the example, the view structure, referenced by the Table_2 repository view, is updated on a database server. The structure is set according to the view structure, referenced by the repository View_1 log.

See also:

IView