Use VST's to identify which table that indexes belong to

emurdock

New Member
Does anyone know how to use the VST's to identify which tables that indexes belong to? I would like to be able to dynamically compact all of the indexes in a storage area that belong to a table over a certain size. I know how to identify the primary index of a table(FIND _index WHERE RECID(_index) = _file._prime-index) , but several of our tables have multiple indexes.

Thanks,
Eric
 

ron

Member
The following code will extract all tables and indexes. A quick change or two and you should be able to get what you want.

Ron.

FOR EACH _StorageObject NO-LOCK

WHERE _StorageObject._Object-type = 2

AND _StorageObject._Area-number > 5:

FIND _Index NO-LOCK

WHERE _Index._Idx-num = _StorageObject._Object-number
NO-ERROR.
IF AVAIL(_Index) THEN

FIND _File NO-LOCK OF _Index NO-ERROR.

DISPLAY

_Index._Index-name WHEN AVAIL(_Index)

FORMAT "x(25)" COLUMN-LABEL "Index!Name"

_File._File-name WHEN AVAIL(_File)

FORMAT "x(15)" COLUMN-LABEL "Table!Name".

END.
 
Top