Feedback
 
Did this article resolve your question/issue?

   

Your feedback is appreciated.

Please tell us how we can make this article more useful. Please provide us a way to contact you, should we need clarification on the feedback provided or if you need further assistance.

Characters Remaining: 1025

 


Article

How to find the Number of an index its Storage Area and Root Block

« Go Back

Information

 
Article Number000022089
EnvironmentProduct: OpenEdge
Version: All supported versions
OS: All supported platforms
Question/Problem Description
How to find the index number?
How to find the Root Block of an index?
How to find the Area Number of an index?
How to find the index number for the -index parameter in a PROUTIL -C dump? 
Steps to Reproduce
Clarifying Information
Error Message
Defect/Enhancement Number
Cause
Resolution
Both the index number and Storage Area Name and number can be found in the Index analysis report which can be run online or offline:
 
$  proutil <dbname> -C idxanalys >> idx.out

Alternatively the _storageobject VST can be used.

Example:
 
DEF VAR cTableName AS CHAR FORMAT 'X(30)' LABEL 'Table Name'.
UPDATE cTableName WITH SIDE-LABELS.

FIND _file WHERE _file-name = cTableName NO-LOCK NO-ERROR.
IF NOT AVAILABLE(_file) THEN MESSAGE "Table does not exist" VIEW-AS ALERT-BOX.
    ELSE DO:
       
        FIND _storageobject WHERE _storageobject._object-type = 1 AND _storageobject._object-number = _file._file-num NO-LOCK NO-ERROR.
        FIND _Area WHERE _Area._Area-number = _storageobject._Area-number NO-LOCK NO-ERROR.
            DISPLAY _Area-name _Storageobject._Area-number.
           
        FOR EACH _index OF _file:
            FIND _storageobject WHERE _storageobject._object-type = 2 AND _storageobject._object-number = _index._idx-num NO-LOCK NO-ERROR.
            FIND _Area WHERE _Area._Area-number = _storageobject._Area-number NO-LOCK NO-ERROR.
                DISPLAY _index-name FORMAT 'x(15)'
                        _Area-name FORMAT 'x(15)'
                        _Storageobject._Area-number FORMAT "->>9"
                        _Storageobject._Object-root LABEL "Root Block" FORMAT "->>>>9"
                        _Storageobject._Object-number LABEL "Index Number" FORMAT "->>9".
        END.
    END.


Alternatively; _file and _index directly.
 
DEFINE VARIABLE i AS CHAR NO-UNDO.
SET i LABEL "TABLE NAME" WITH FRAME A.

FIND FIRST _file WHERE _file._file-name = i NO-LOCK.
IF AVAILABLE _file THEN DO:
FOR EACH _index OF _file:
   DISPLAY _index._index-name FORMAT "X(13)"
           _index._idx-num 
           _index._unique
           _index._Active
           _index._Wordidx SKIP.
END. 
END.
Workaround
Notes
Attachment 
Last Modified Date6/8/2017 9:01 AM