IDalConnection.Indexes

Syntax

Indexes(TableName: String): IDalIndexes;

Parameters

TableName. Physical name of the table in the database.

Description

The Indexes property returns the cursor containing system information about specified table indexes.

Comments

If an empty row is specified as the value of the TableName parameter, the property returns the cursor containing the information about the indexes of all the tables, which are in the database.

Fore Example

Sub UserProc;
Var
    Driver: IDalDriver;
    Connect: IDalConnection;
    IndexCur: IDalIndexes;
    ConnectDesc: IDalConnectionDescriptor;
    ConnectDescParams: IDalConnectionDescriptorParams;
    IndexFields: IDalCursorFields;
    IndexField: IDalCursorField;
    i: Integer;
Begin
    Driver := New DalOrcl8Driver.Create;
    ConnectDesc := Driver.CreateDescriptor;
    ConnectDescParams := ConnectDesc.Params;
    ConnectDescParams.Find("User Name").Value := "User";
    ConnectDescParams.Find("Password").Value := "Password";
    ConnectDescParams.Find("Host BSTR").Value := "OrclServer";
    ConnectDescParams.Find("Schema").Value := "Repository";
    Connect := ConnectDesc.CreateConnection;
    //Parameters of DataTable table indexes
    IndexCur := Connect.Indexes("DataTable");
    IndexFields := IndexCur.Fields;
    //View parameters and their values
    While Not IndexCur.Eof Do
        i := i + 1;
        Debug.WriteLine("Index number: " + i.ToString);
        Debug.Indent;
        For Each IndexField In IndexFields Do
            Debug.WriteLine(IndexField.Name + " = " + IndexField.Value);
        End For;
        Debug.Unindent;
        IndexCur.Next;
    End While;
    IndexCur.Close;
    Connect.Close;
End Sub UserProc;

On executing the example the repository connection is established with specified location parameters. A cursor with parameters of DataTable table indexes is created based on the connection. Information about parameters and their values is displayed in the development environment console.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Dal;
Imports Prognoz.Platform.PiLibNet.Utils;

Sub UserProc();
Var
    Driver: DalOrcl8Driver = ComCreator.Instance.CoCreate<DalOrcl8DriverClass>();
    Connect: IDalConnection;
    IndexCur: IDalIndexes;
    ConnectDesc: IDalConnectionDescriptor;
    ConnectDescParams: IDalConnectionDescriptorParams;
    IndexFields: IDalCursorFields;
    IndexField: IDalCursorField;
    i: Integer;
Begin
    ConnectDesc := Driver.CreateDescriptor();
    ConnectDescParams := ConnectDesc.Params;
    ConnectDescParams.Find("User Name").Value := "User";
    ConnectDescParams.Find("Password").Value := "Password";
    ConnectDescParams.Find("Host BSTR").Value := "OrclServer";
    ConnectDescParams.Find("Schema").Value := "Repository";
    Connect := ConnectDesc.CreateConnection();
    //Parameters of DataTable table indexes
    IndexCur := Connect.Indexes["DataTable"];
    IndexFields := IndexCur.Fields;
    //View parameters and their values
    While Not IndexCur.Eof() Do
        i := i + 1;
        System.Diagnostics.Debug.WriteLine("Index number: " + i.ToString());
        System.Diagnostics.Debug.Indent();
        For Each IndexField In IndexFields Do
            System.Diagnostics.Debug.WriteLine(IndexField.Name + " = " + IndexField.Value);
        End For;
        System.Diagnostics.Debug.Unindent();
        IndexCur.Next();
    End While;
    IndexCur.Close();
    Connect.Close();
End Sub;

See also:

IDalConnection