Database: IDatabase;
Database: Prognoz.Platform.Interop.Db.IDatabase;
The Database property determines a database, in which extended data warehouse repository objects are stored.
The IDWRepositoryDatabase interface is outdated.
The Extended Data Warehouse Repository object is used only to support earlier versions.
Working with extended data warehouse repository without a database is impossible. The IDWRepositoryDatabaseInstance.Database method is used to get a database of open instance of extended data warehouse repository.
Executing the example requires that the repository contains a database with the DATA identifier.
Add links to the Db and Metabase system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
Inf: IMetabaseObjectCreateInfo;
Des: IMetabaseObjectDescriptor;
Dw: IDWRepositoryDatabase;
Begin
Mb := MetabaseClass.Active;
Inf := Mb.CreateCreateInfo;
Inf.ClassId := MetabaseObjectClass.KE_CLASS_DW_REPOSITORYDB;
Inf.Id := Mb.GenerateId("DW_REPO");
Inf.Name := Inf.DefaultName;
Inf.KeepEdit := True;
Inf.Permanent := False;
Des := Mb.CreateObject(Inf);
Dw := Des As IDWRepositoryDatabase;
Dw.Database := Mb.ItemById("DATA").Bind As IDatabase;
(Dw As IMetabaseObject).Save;
End Sub UserProc;
After executing the example an extended data warehouse is created in repository root.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Db;
…
Public Shared Sub Main(Params: StartParams);
Var
Mb: IMetabase;
Inf: IMetabaseObjectCreateInfo;
Des: IMetabaseObjectDescriptor;
Dw: IDWRepositoryDatabase;
Begin
Mb := Params.Metabase;
Inf := Mb.CreateCreateInfo();
Inf.ClassId := MetabaseObjectClass.KE_CLASS_DW_REPOSITORYDB As Integer;
Inf.Id := Mb.GenerateId("DW_REPO", 0);
Inf.Name := Inf.DefaultName;
Inf.KeepEdit := True;
Inf.Permanent := False;
Des := Mb.CreateObject(Inf);
Dw := Des As IDWRepositoryDatabase;
Dw.Database := Mb.ItemById["DATA"].Bind() As IDatabase;
(Dw As IMetabaseObject).Save();
End Sub;
See also: