FetchVersion;
FetchVersion();
The FetchVersion method receives the current repository version specified in the Repository property.
Use the VersionMajor, VersionMinor and VersionUnicode properties to view the information about the repository version.
Executing the example requires the ORCL server named Test. The TestSchema scheme is created on the server. A repository and MDM repository are created within this scheme.
Add links to the Dal, Fore system assemblies.
Sub UserProc;
Var
Rsm: IRepositoryScriptManager;
Driv: IDalDriver;
ConDesc: IDalConnectionDescriptor;
Params: IDalConnectionDescriptorParams;
Con: IDalConnection;
Begin
//Connection to schema on the Oracle server
Driv := New DalOrcl8Driver.Create As IDalDriver;
ConDesc := Driv.CreateDescriptor;
Params := ConDesc.Params;
Params.Find("User Name").Value := "TestSchema";
Params.Find("Password").Value := "TestSchema";
Params.Find("Host BSTR").Value := "Test";
Params.Find("Schema").Value := "TestSchema";
Con := ConDesc.CreateConnection;
//Repository manager settings
Rsm := New RepositoryScriptManager.Create;
Rsm.Connection := Con;
Rsm.Driver := RepositoryDriverType.ORCL9;
//Get version for repository
Rsm.Repository := RepositoryType.Metabase;
Rsm.FetchVersion;
Debug.WriteLine("Repository version");
Debug.WriteLine(Rsm.VersionMajor.ToString);
Debug.WriteLine(Rsm.VersionMinor.ToString);
//Get version for MDM repository
Rsm.Repository := RepositoryType.RDS;
Rsm.FetchVersion;
Debug.WriteLine("MDM repository version");
Debug.WriteLine(Rsm.VersionMajor.ToString);
Debug.WriteLine(Rsm.VersionMinor.ToString);
If Rsm.VersionUnicode Then
Debug.WriteLine("Unicode version of MDM repository");
Else
Debug.WriteLine("Not unicode version of MDM repository");
End If;
End Sub UserProc;
Imports Prognoz.Platform.Interop.Dal;
Imports Prognoz.Platform.Interop.KeFore;
Public Shared Sub Main(Params: StartParams);
Var
Rsm: IRepositoryScriptManager = New RepositoryScriptManagerClass();
Driv: IDalDriver = New DalOrcl8DriverClass();
ConDesc: IDalConnectionDescriptor;
DalParams: IDalConnectionDescriptorParams;
Con: IDalConnection;
Begin
//Connection to schema on the Oracle server
ConDesc := Driv.CreateDescriptor();
DalParams := ConDesc.Params;
DalParams.Find("User Name").Value := "TestSchema";
DalParams.Find("Password").Value := "TestSchema";
DalParams.Find("Host BSTR").Value := "Test";
DalParams.Find("Schema").Value := "TestSchema";
Con := ConDesc.CreateConnection();
//Repository manager settings
Rsm.Connection := Con;
Rsm.Driver := RepositoryDriverType.repwelknodritypORCL9;
//Get version for repository
Rsm.Repository := RepositoryType.reptypMetabase;
Rsm.FetchVersion();
System.Diagnostics.Debug.WriteLine("Repository version");
System.Diagnostics.Debug.WriteLine(Rsm.VersionMajor.ToString());
System.Diagnostics.Debug.WriteLine(Rsm.VersionMinor.ToString());
//Get version for MDM repository
Rsm.Repository := RepositoryType.reptypRDS;
Rsm.FetchVersion();
System.Diagnostics.Debug.WriteLine("MDM repository version");
System.Diagnostics.Debug.WriteLine(Rsm.VersionMajor.ToString());
System.Diagnostics.Debug.WriteLine(Rsm.VersionMinor.ToString());
If Rsm.VersionUnicode Then
System.Diagnostics.Debug.WriteLine("Unicode version of MDM repository");
Else
System.Diagnostics.Debug.WriteLine("Not unicode version of MDM repository");
End If;
End Sub;
The connection to the TestSchema scheme placed on the Test server is set when executing this example. The versions that have repository or MDM repository created in this scheme are displayed in the development environment console.
See also: