IDalConnection2.Discover

Fore Syntax

Discover(SystemDictionary: DalSystemDictionary; Filter: String): IDalCursor;

Fore.NET Syntax

Discover(SystemDictionary: Prognoz.Platform.Interop.Dal.DalSystemDictionary; Filter: String): Prognoz.Platform.Interop.Dal.IDalCursor;

Parameters

SystemDictionary. Type of cursor received after executing the SQL query to the database.

Filter. Filter that is applied to the cursors received after executing the SQL query to the database.

Description

The Discover method returns the appropriate cursor depending on the SystemDictionary parameter.

Comments

If the driver does not support the appropriate SystemDictionary, Null is returned.

Fore Example

To execute the example, connect the Metabase and Dal system assemblies to the module.

Sub Macro;
Var
    MB: IMetabase;
    DB: IDatabaseInstance;
    Cur: IDalCursor;
    Field: IDalCursorField;
Begin
    MB := MetabaseClass.Active;
    DB := MB.ItemById("BD").Open(NullAs 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 the example the system information about the tables stored in the specified database is displayed in the console window.

Fore.NET Example

Th specified 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(NullAs 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 the example the system information about the tables stored in the specified database is displayed in the console window.

See also:

IDalConnection2