Discover(SystemDictionary: DalSystemDictionary; Filter: String): IDalCursor;
Discover(Prognoz.Platform.Interop.Dal.DalSystemDictionary,System.String): Prognoz.Platform.Interop.Dal.IDalCursor;
SystemDictionary. Type of the cursor, obtained when executing SQL query to DB.
Filter. The filter, applied to the cursors, obtained when executing SQL query to DB.
The Discover method returns the corresponding cursor depending on the SystemDictionary parameter.
If the driver doesn't support the corresponding SystemDictionary, Null is returned.
To execute the example, add the Metabase and the Dal system assemblies to the module.
Sub Macro;
Var
MB: IMetabase;
Driv: IDalDriver;
Connect: IDalConnection;
Connect2: IDalConnection2;
ConnectDesc: IDalConnectionDescriptor;
ConnectDescParams: IDalConnectionDescriptorParams;
cursor: IDalCursor;
Begin
MB := MetabaseClass.Active;
Driv := New DalOrclDriver.Create;
ConnectDesc := Driv.CreateDescriptor;
ConnectDescParams := ConnectDesc.Params;
ConnectDescParams.Find("User Name").Value := "P5repository";
ConnectDescParams.Find("Password").Value := "P5repository";
ConnectDescParams.Find("Host BSTR").Value := "test";
ConnectDescParams.Find("Scheme").Value := "P5repository";
Connect := ConnectDesc.CreateConnection;
Connect2 := Connect As IDalConnection2;
cursor:= Connect2.Discover(DalSystemDictionary.Tables, "");
debug.WriteLine(Connect2.Type);
Connect:=Connect2.Clone(DalConnectionType.Async);
End Sub Macro;
After executing the example system information about the tables, stored in the specified scheme, is displayed in the console window.
The Macro procedure is an entry point for .NET assembly.
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Dal;
...
Public Shared Sub Macro(Params: StartParams);
Var
MB: IMetabase;
Driv: IDalDriver;
Connect: IDalConnection;
Connect2: IDalConnection2;
TabCur: IDalTables;
ConnectDesc: IDalConnectionDescriptor;
ConnectDescParams: IDalConnectionDescriptorParams;
cursor: IDalCursor;
Begin
MB := Params.Metabase;
Driv := New DalOrclDriver.Create();
ConnectDesc := Driv.CreateDescriptor();
ConnectDescParams := ConnectDesc.Params;
ConnectDescParams.Find("User Name").Value := "P5repository";
ConnectDescParams.Find("Password").Value := "P5repository";
ConnectDescParams.Find("Host BSTR").Value := "test";
ConnectDescParams.Find("Scheme").Value := "P5repository";
Connect := ConnectDesc.CreateConnection();
Connect2 := Connect As IDalConnection2;
cursor:= Connect2.Discover(DalSystemDictionary.dsdTables, "");
System.Diagnostics.Debug.WriteLine(Connect2.Type);
Connect:=Connect2.Clone(DalConnectionType.dctAsync);
End Sub;
After executing the example system information about the tables, stored in the specified scheme, is displayed in the console window.
See also: