Discover(SystemDictionary: DalSystemDictionary; Filter: String): IDalCursor;
Discover(SystemDictionary: Prognoz.Platform.Interop.Dal.DalSystemDictionary; Filter: String): Prognoz.Platform.Interop.Dal.IDalCursor;
SystemDictionary. It is a type of cursor received after executing the SQL query to the database.
Filter. It is a filter that is applied to the cursors received after executing the SQL query to the database.
The Discover method returns the appropriate cursor depending on the SystemDictionary parameter.
If the driver does not support the appropriate SystemDictionary, Null is returned.
Connect the Metabase and Dal system assemblies to the module to execute the example.
Sub Macro;
Var
MB: IMetabase;
DB: IDatabaseInstance;
Cur: IDalCursor;
Field: IDalCursorField;
Begin
MB := MetabaseClass.Active;
DB := MB.ItemById("BD").Open(Null) As IDatabaseInstance;
Cur := DB.Connection.Discover(DalSystemDictionary.Tables, "");
While Not Cur.Eof Do
For Each Field In Cur.Fields Do
Debug.WriteLine(Field.Name + " " + Field.Value);
End For;
Debug.WriteLine("");
Cur.Next;
End While;
Cur.Close;
End Sub Macro;
After executing this example the system information about the tables stored in the specified database is displayed in the console window.
This procedure is an entry point of the .NET assembly.
Imports Prognoz.Platform.Interop.Dal;
Imports Prognoz.Platform.Interop.Metabase;
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
DB: IDatabaseInstance;
Cur: IDalCursor;
Field: IDalCursorField;
Begin
MB := Params.Metabase;
DB := MB.ItemById("BD").Open(Null) As IDatabaseInstance;
Cur := DB.Connection.Discover(DalSystemDictionary.dsdTables, "");
While Not Cur.Eof Do
For Each Field In Cur.Fields Do
System.Diagnostics.Debug.WriteLine(Field.Name + " " + Field.Value);
End For;
System.Diagnostics.Debug.WriteLine("");
Cur.Next();
End While;
Cur.Close();
End Sub;
After executing this example the system information about the tables stored in the specified database is displayed in the console window.
See also: