Feedback
Did this article resolve your question/issue?

   

Article

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

« Go Back

Information

 
TitleHow to find the Number of an index its Storage Area and Root Block
URL NameP8966
Article Number000157512
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
Last Modified Date6/8/2017 9:01 AM
Attachment 
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.