Toad World® Forums

How to generate a report to pull complete list of Index?


#1

Hello,

I have .txp file with 400 plus tables. I am trying to generate a report which shows the complete list of Index created in all the tables.

In model properties I could see the count of index available in my .txp file.
Is there any option to pull all the indexes ? please advise.

Thanks !!
Rajesh


#2

Hi Raaj,
in reports is Indexes page. If you want to report only indexes(fro example in html report), please run report wizard. On “What to Report” page uncheck all, and select only indexes. When you select indexes, Entities node will checked too. If you don’t want report Entities, please switch off autocheck button (above select tree).
image
On the last page “Option” you can uncheck “Generate ER Diagram”.

Second way is report indexes list by simple script. In scripting window you can use this

function main(){
  var i, j, Ent, Index;
  for(i=0;i<Model.Entities.Count-1;i++)
  {
    Ent = Model.Entities.GetObject(i);
    for(j=0;j<Ent.Indexes.Count;j++)
    {
      Index = Ent.Indexes.GetObject(j);
      Log.Information(Ent.Name+'.'+Index.Name);
    }    
  }
}

best regard
Daril