Skip to main content

How to get the database's index information ?

Hi Brian,
If I have a IDEA file and there exist 4 index , have any possible to write a function to get all index information  ?
Thanks,
Derek
 
 

Brian Element Thu, 09/28/2017 - 07:03

Hi Derek,

There is no way that I know of to get the different indexes from IDEAScript.  What are you thinking of doing with them?

Brian

Derek Thu, 09/28/2017 - 08:42

Hi Brian,
I notes if the IDEA file have more and more index the file size will become more big. Because we need to keep our project data when we final the project. So I’m thinking if I have a script to determine all IDEA files index and delete then automated , that will reduce the file sizes.
 
Derek

Brian Element Thu, 09/28/2017 - 09:52

There is no way that I know of to get the indices that have been created.  If you are creating them in your script you could probably track them and then delete those indices using the task.DeleteIndex


Sub Main
' Open the database.
Set db = Client.OpenDatabase("Sample-Customers.IMD")
' Create the task.
Set task = db.Index
' Set the index.
task.AddKey "COMPANY", "A"
' Remove the index.
task.DeleteIndex
' Clear the memory.
Set db = Nothing
Set task = Nothing
End Sub