Consultor Eletrônico



Kbase 19573: What storage area does a table or an index resides in?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   01/05/2002
PROBLEM:

You need to find out, what area does a field or index resides in.

SOLUTION:

The information is stored in table _StorageObject.


FIND _storageobject WHERE
_storageobject._object-number = number AND
_storageobject._object-type = type
NO-LOCK NO-ERROR.

IF AVAILABLE _storageobject THEN
FIND _area WHERE
_area._area-number = _storageobject._area-number
NO-LOCK NO-ERROR.

DISPLAY _area._area-name.

...

number is the _file-number from table _file for fields and
_idx-num from table _index for indexes.

type is 1 for tables and 2 for indexes.

Examples:

/* Following code lists all Index Names, Numbers and Areas */

FOR EACH _storageobject WHERE _storageobject._object-type = 2 NO-LOCK:
FIND _Index WHERE _index._idx-num = _storageobject._Object-number NO-LOCK NO-ERROR.
FIND _area WHERE _area._area-number = _storageobject._area-number NO-LOCK NO-ERROR.
DISPLAY _index-name FORMAT "x(25)"_idx-num _area._area-name FORMAT "X(25)".
END.


/* Following code lists all table Names, Numbers and Areas */

FOR EACH _storageobject WHERE _storageobject._object-type = 1 NO-LOCK:
FIND _File WHERE _File._File-Number = storageobject._Object-number NO-LOCK NO-ERROR.
FIND _area WHERE _area._area-number = _storageobject._area-number NO-LOCK NO-ERROR.
DISPLAY _File-name FORMAT "x(25)"_File-Number _area._area-name FORMAT "X(25)".
END.


FURTHER COMMNENTS:

The tables _file and _index contain field _ianum. This field does
not contain the actual area number for the object. It is used at
table creation time only and is not updated by index or table move.


Ales Zeman (07-MAR-2000)