The OBJ function returns information about an analytic workspace object.
The return value depends on the value specified for choice. Also, when choice is applicable to only a specific type of object, and you specify a different type of object for object-name, then OBJ returns NA
unless otherwise noted.
A TEXT
expression that is the name of the object that you want to retrieve information about.
A keyword or keyword phrase which indicates the type of information you want. See Table 8-2, "Keywords for the choice argument of the OBJ Function" for the syntax, data type of the returned value and description of valid keywords.
Table 8-2 Keywords for the choice argument of the OBJ Function
Keyword for choice | Data Type | Description of Returned Value |
---|---|---|
ACQUIRED |
BOOLEAN |
Whether the specified object has been acquired for modification in multiwriter mode. For a partitioned variable, returns YES only when all of the partitions of that variable have been acquire. |
ACQUIREDPARTITIONS |
TEXT (multiline) |
The names of the partitions of the variable specified by object-name that are acquired for modification in multiwriter mode. |
AGGMAP |
TEXT (multiline) |
The specification of the specified aggmap. |
AGGMAPLIST |
TEXT (multiline) |
|
ALIASLIST |
TEXT (multiline) |
The names of the alias dimensions for the specified dimension. |
ALIASOF |
TEXT |
The name of the base dimension for the specified alias dimension. |
AW |
TEXT |
The name of an attached workspace that contains the specified object. When the specified object is in only one attached workspace, AW returns the name of the workspace. When the specified object is in multiple attached workspaces, AW still returns only one workspace name. You must use the AWLIST keyword to get all the relevant workspace names. When the object is not in any attached workspace, AW returns |
AWLIST |
TEXT (multiline) |
The names of the attached workspaces that contain an object with the specified name. When you specify a qualified object name for the object, AWLIST returns only the relevant workspace name. When no workspace contains the specified object, AWLIST returns |
BTREE |
BOOLEAN |
Whether a BTREE index was defined for the specified conjoint dimension or composite. |
CACHEEMPTY |
BOOLEAN |
Whether a session cache has been emptied of data for the specified variable. A cache can be emptied by using a CLEAR statement with the CACHE keyword. When object-name is not a variable or when it has no session cache, then CACHEEMPTY returns |
CACHECOUNT |
LONG INTEGER |
The number of non- |
CHANGED |
BOOLEAN |
Whether the specified variable, relation, dimension, or valueset has been modified since the last UPDATE. |
CLASS |
TEXT |
The storage class of the specified object. Possible return values are:
|
DATA |
TEXT |
The data type of the specified object.
|
DEFINE |
TEXT (multiline) |
The description of the specified object. The value is the same value that DESCRIBE would display for the object minus the words DEFINE and the name of the object. |
DFNCHANGED |
BOOLEAN |
Whether the definition of the specified object has changed since the last UPDATE. |
DFNDIMS |
TEXT (multiline) |
The names of the dimensions and composites in the dimension list that is used to define the specified object. Note that:
|
DIMMAX |
INTEGER |
The number of values in the specified dimension. For other object types, it returns Note: When you use the DIMMAX choice with a dimension that has a read permission that restricts access to the dimension values, the result returned depends on whether the dimension has previously been loaded. Permissions are evaluated when an object is loaded. Generally, the first time you refer to an object in your session, Oracle OLAP loads the object and evaluates its permissions. However, the OBJ function does not load objects, because it is just providing information about them. When you use DIMMAX with a dimension that has not yet been loaded, the result reflects the entire number of values in the dimension, regardless of whether the dimension has read permissions. When a dimension with permissions has been loaded, then the DIMMAX choice reflects the permitted size. To ensure that the DIMMAX choice returns the permitted size, you can execute a LOAD statement before using the OBJ function. |
DIMS |
TEXT (multiline) |
The names of the dimensions of the specified object. Specifically:
|
DIMTYPE |
TEXT |
The type of the specified dimension. Specifically:
|
DISKSIZE |
INTEGER |
The total number of pages used to store the specified object. Note: For a temporary object, OBJ(DISKSIZE) returns a value of 0 (zero), because the values of a temporary object are stored in temporary storage and not in the database file. |
FORMULA |
TEXT |
|
HASAGGCOUNT |
BOOLEAN |
Whether an Aggcount object is associated with the specified variable. (For more information on Aggcount variables, see "Aggcount Variables".) |
HASCACHE |
BOOLEAN |
Whether a session cache that is local to the session has been established to store data for the specified variable. (For more information on the session cache, see "What is an Oracle OLAP Session Cache?".) |
HASH |
BOOLEAN |
Whether a HASH index was defined for the specified conjoint dimension or composite. |
HASHSIZE |
INTEGER |
The number of pages allocated for the specified hashed dimension's TBLSPACE (that is, the page space containing the anchors for the hash table's K/V node lists). Note that this does not include the number of pages used for the actual Key/Value nodes, which are allocated from the RANSPACE's page space (KVPAGES). |
HASPROPERTY prop-name |
BOOLEAN |
Whether the property specified by prop-name exists for the specified object. (Abbreviated HASPRP) |
HIDDEN |
BOOLEAN |
Whether the text of the specified program or model has been hidden. (For more information on hiding programs and models, see the HIDE and UNHIDE commands.) |
INDEXSIZE |
INTEGER |
The total size of all inversions associated with the specified relation or conjoint dimension. |
INORDER |
BOOLEAN |
Whether the logical order of the values of the underlying dimensions of the specified object matches the physical order in the analytic workspace. INORDER returns |
ISBY [RECURSIVE] dimname |
BOOLEAN |
When you supply object-name, whether the specified object is dimensioned by, related to, or a surrogate for the specified dimension (dimname). When you supply only dimname, whether an object is dimensioned by the dimension you specify in dimname; or when the object is an aggmap, whether the specified dimension is a dimension of any relations or models in the aggmap.
Specify a value for object-name when the object is a dimension surrogate, variable, relation, or valueset name to learn if that object is dimensioned by or related to or a surrogate for the specified dimension. You can omit object-name when you are looping through the list of workspace objects to obtain information about multiple objects, or when you are using OBJ to limit the NAME dimension. |
ISCOMPILED |
BOOLEAN |
Whether the compilation status of the specified compilable object (such as a program, model, or formula). The value returned depends on the type of object and on whether a compilation error was found in that object. For example:
|
ISCOMPRESSED |
BOOLEAN |
Whether the specified object is a compressed composite. |
ISLATEST |
BOOLEAN |
Whether the specified object is the latest version of the object. This syntax is the equivalent of |
ISSOLVED |
BOOLEAN |
When the specified object is a variable which is dimensioned by a compressed composite, whether the variable has been aggregated. |
KVSIZE |
INTEGER |
The number of pages currently allocated to hash and BTREE indexes. |
LATESTVER |
INTEGER |
The current state of the specified object, referring to the most recently committed version of the object. The returned value is either equal to or greater than the value returned by |
LD |
TEXT (multiline) |
The LD (long description) of the specified object. |
MODEL |
TEXT (multiline) |
The specification of the specified model. |
NACACHECOUNT |
INTEGER |
The total number of |
NACACHEEMPTY |
BOOLEAN |
Whether the |
NAPAGES |
INTEGER |
The number of pages that contain only |
NOHASH |
BOOLEAN |
Whether the specified conjoint dimension uses the NOHASH index algorithm to load and access data. |
NUMCELLS |
INTEGER |
The total number of physical cells within the specified variable. Oracle OLAP determines this value by finding the Cartesian product of the |
NUMDELS |
DECIMAL |
The number of deleted cells for the specified dimensioned object. |
NUMDFNDIMS |
INTEGER |
The number of dimensions or composites in the dimension list used to define the specified object. For this count, each composite counts as one, and the dimensions within the dimension list of the composite are not counted. An object defined with a dimension list could be a variable, relation, formula, valueset, concat or conjoint dimension, dimension surrogate, or composite. When no dimension list was used when defining the object (as for single-cell variables, programs, and so on.), it returns |
NUMDIMS |
INTEGER |
The number of dimensions of the specified dimensioned object; or the number of base dimensions of the specified composite. When the specified object is a dimension is a dimension or dimension surrogate, it returns |
NUMSEGS |
INTEGER |
The number of analytic workspace segments associated with the specified object when that object has multiple dimensions. (Note that Oracle OLAP uses segments internally to keep track of the physical storage of the object's values. Too many segments may slow the retrieval of information.) |
NUMVALS |
INTEGER |
The number of values or cells in the specified object. For a compressed composite or a variable dimensioned by a compressed composite, returns an |
OWNSPACE |
BOOLEAN |
When the specified object is a conjoint dimension or a composite defined with a BTREE index algorithm, whether the object is using private page space to store BTREE nodes. When the specified object is a variable-width text dimension, a relation, or a variable-width text variable, whether the data for the object is stored in one or more private page spaces that are associated with that object. |
PARTBY |
TEXT (multiline) |
The names of the partition dimensions of the specified partitioned variable or partition template object. The names are returned as a multiline text value (one line for each dimension). |
PARTDIMS partitions |
TEXT (multiline) |
The names of the dimensions of the partitions of the specified partition template or a partitioned variable. The value is returned as a multiline text value (one line for each dimension). partitions is a multiline text value (one line for each partition name) that specifies which partitions you're asking about. When you specify a partition name that is not a valid partition in partitions, an error occurs. |
PARTITION partitions |
TEXT (multiline) |
For a partitioned variable or a partition template object, a textual description of the partitions of the specified partition template or a partitioned variable. When called on a partition template, the returned description is similar to the DEFINE PARTITION TEMPLATE statement. When called on a partitioned variable, the returned description is similar to the DEFINE VARIABLE statement. partitions is a multiline text value (one line for each partition name) that specifies which partitions you're asking about.When you specify a partition name that is not a valid partition in partitions, an error occurs. |
PARTMETH |
TEXT |
The method ( |
PARTNAMES |
TEXT (multiline) |
A multiline Note: Not all of the partitions defined by a partition template necessarily exist in each partitioned variable. Calling |
PARTRANGE partitions |
TEXT (multiline) |
The values of the partitions is a multiline text value (one line for each partition name) that specifies which partitions you're asking about. When you specify a partition name that is not a valid partition in partitions, an error occurs. |
PERIOD |
TEXT |
When the specified object is a dimension of type DAY, WEEK, MONTH, QUARTER, or YEAR, the type of the dimension plus an indication of multiple periods or phasing, if any. |
PHYSMAX |
INTEGER |
The maximum physical value for positions within the specified dimension or composite. |
PMTMAINTAIN |
TEXT |
The permission condition for the maintain permission associated with the specified dimension. When there is no maintain permission for the dimension, it returns |
PMTPERMIT |
TEXT |
The permission condition for the permit permission associated with the specified object. When there is no permit permission for the object, it returns |
PMTREAD |
TEXT |
The permission condition for the read permission associated with the specified object. When there is no read permission for the object, it returns |
PMTWRITE |
TEXT |
The permission condition for the write permission associated with the specified object. When there is no write permission for the object, it returns |
PRECISION |
INTEGER |
The precision of the specified |
PROGRAM |
TEXT (multiline) |
The text of the specified program. |
PROPCHANGED |
BOOLEAN |
Whether the properties of the specified object have changed since the last UPDATE. |
PROPERTY prop-name |
WORKSHEET |
The value of the specified object's property as specified by prop-name which is a text expression that specifies the name of the property. The data type of the return value is determined at run time. When the named property does not exist, it returns |
PROPERTYLIST |
TEXT (multiline) |
The names of the properties associated with the specified object, one property on a line. The names are in uppercase letters and are stored in the collating sequence for ASCII characters. For objects without properties, it returns |
PROPERTYTYPE prop-name |
TEXT |
The data type of object's property as specified by prop-name which is a text expression that specifies the name of the property. The type is derived from the expression used in the PROPERTY statement that created the property. Possible return values are |
PUSHCOUNT |
INTEGER |
The number of times PUSH has executed for the specified executed (that is, the number of pushed values currently saved for the specified object). |
REFERS [RECURSIVE] text-expression |
TEXT (multiline) |
The words found in the specified compilable object (for example, a program) that match the ones you specify in text-expression. REFERS returns
Tip: The search is not case-sensitive; REFERS treats |
RELATION relation-query |
TEXT (multiline) |
The default relation (as specified the RELATION command) for the specified object. The values that are returned vary depending on what you specify for relation-query. The syntax for relation-query is: DEFINELIST | DIMLIST | ACTUAL rel-dimname | SPECIFIED rel-dimname where:
|
RSSIZE |
INTEGER |
The number of random subset pages used by main object. |
SCALE |
INTEGER |
The scale of a |
SEGWIDTH {dim-name|ALL} |
TEXT (multiline) |
The default or user-specified segment size of a variable that has multiple dimensions and that is associated with either a particular dimension or all dimensions. Each line begins with a segment-size (up to 11 digits) followed by the name of the associated dimension or composite. The dimension name is not included in the line when you specify a dimension and its dimensioned object. In that case only the segment value is returned. When the segment size is reported as zero, it means the default segment size is in effect, and therefore you may have to use CHGDFN to set an appropriate size for the variable's segments.
|
SESSION |
BOOLEAN |
Whether the specified object is a session object. |
SHAREMAP |
BOOLEAN |
When the specified object is dimensioned by a compound dimension, whether the compound dimension is shared with other objects. |
SPARSE |
TEXT (multiline) |
The composites used in the definition of the specified object. |
SURROGATELIST |
TEXT (multiline) |
The surrogates defined for the specified surrogate or dimension. |
TRIGGER [triggering-event} |
TEXT (multiline) |
TRIGGER without a triggering-event keyword returns all the triggering-event keywords and trigger programs names associated with the specified object; or Specify the triggering-event using one of the following keywords:
|
TYPE |
TEXT |
The object type of the specified object. |
UNIQUE |
BOOLEAN |
Whether the specified concat dimension is unique. Returns |
UPDATED |
BOOLEAN |
When the analytic workspace is attached in multiwriter mode, whether the specified object been updated. For other attachment modes, returns |
VALCOUNT |
INTEGER |
The number of logical uncompressed values in the specified compressed composite. For all other dimensions the result is identical to DIMMAX. |
VALSIZE |
INTEGER |
The number of pages used to store the specified object's values. For text dimensions and variables defined without the WIDTH keyword, OBJ(VALSIZE) counts only those pages that contain the four-byte pointers to the text, not the storage for the text itself. For a temporary variable, OBJ(VALSIZE) returns a value of 0 (zero) because the values of a temporary variable are stored in temporary storage and not in the analytic workspace. |
VERSION |
INTEGER |
The current state of the attached version of the specified object. (Note that changes that are updated and committed increase this number.) |
VNF |
TEXT |
When the specified object is a dimension of type DAY, WEEK, MONTH, QUARTER, or YEAR for which you have defined a VNF (value name format), the VNF of the dimension. For other types of objects, it returns |
WIDTH |
INTEGER |
The width, in bytes, of the storage area of each value of the specified object:
|
A text expression that contains the name of the object in which you are interested. The object can be in any attached workspace. When you specify object-name as a text literal, you must enclose it in single quotes. (Oracle OLAP automatically converts the name to uppercase.) When you specify the name of a program as the object-name and you omit the quotes, Oracle OLAP runs the program and uses its return value as the name of the object to be supplied as object-name.
You can omit object-name when you are using the OBJ function as part of a statement, such as the LIMIT command, that loops through the NAME dimension. In this case, the return value is dimensioned by the NAME dimension in the current workspace.
See also:
For examples of using the OBJ function to retrieve default relation information, see Example 10-95, "Specifying a Default Relation Using the Relation Command"Example 8-47 Listing Dimensions
Suppose you want a list of all the dimensions in an analytic workspace. First, use a LIMIT command and the OBJ function to limit the status of the NAME dimension. Then use a STATUS statement to produce a list of dimensions. Because the values returned by OBJ(TYPE)
are always in uppercase, you must use 'DIMENSION'
(not 'dimension'
) in the LIMIT statement to get a match. The statements
LIMIT NAME TO OBJ(TYPE) EQ 'DIMENSION' STATUS NAME
produce the following output.
The current status of NAME is: PRODUCT, DISTRICT, DIVISION, LINE, REGION, MARKETLEVEL, MARKET, MONTH, YEAR, QUARTER
Example 8-48 Listing Relations
Suppose you want to see the definitions of all the relations in an analytic workspace. Use the LIMIT command and the OBJ function to select these names. Then use DESCRIBE to produce a list of their definitions. The statements
LIMIT NAME TO OBJ(TYPE) EQ 'RELATION' DESCRIBE
produce the following output.
DEFINE REGION.DISTRICT RELATION REGION <DISTRICT> LD REGION for each DISTRICT DEFINE DIVISION.PRODUCT RELATION DIVISION <PRODUCT> LD DIVISION for each PRODUCT DEFINE MLV.MARKET RELATION MARKETLEVEL <MARKET> DEFINE MARKET.MARKET RELATION MARKET <MARKET> LD Self-relation for the Market Dimension
For example, the following statement limits NAME to all the objects dimensioned by month
.
LIMIT NAME TO OBJ(ISBY 'month')
You can use ISBY to find out if a dimension is a base dimension of a concat or conjoint dimension or a composite. For example, assume that you had a conjoint dimension named proddist
whose base dimensions were product
and district
. In this case, the following statement returns YES
.
SHOW OBJ(ISBY 'district' 'proddist')
You can use ISBY to find out if a dimension is a dimension of a relation or a model used in an aggmap. For example, assume that you had an aggmap called myaggmap
and you wanted to find out if a dimension named mydimension
was used in any relations or models within myaggmap
. In this case, you could issue the following statement.
SHOW OBJ(ISBY 'mydimension' 'myaggmap')
To determine whether a specified dimension is a base dimension at any level, you must use ISBY with the RECURSIVE keyword. For example, assume that you had a conjoint dimension named proddist.mon
whose base dimensions were proddist
and month
and a variable proddist.sales
dimensioned by proddist
. In this case, each of the following statements would return NO
.
SHOW OBJ(ISBY 'district' 'proddist.mon') SHOW OBJ(ISBY 'district' 'proddist.sales')
However, when you use ISBY with the RECURSIVE keyword, each of the following statements would return YES
.
SHOW OBJ(ISBY RECURSIVE 'district' 'proddist.mon') SHOW OBJ(ISBY RECURSIVE 'district' 'proddist.sales')
Example 8-50 Getting Information about a Variable
This example illustrates the use of several choices of the OBJ function to obtain information about the variable sales
. The definition of sales
is as follows.
DEFINE sales VARIABLE DECIMAL <month product district> LD Sales Revenue
The statement
SHOW OBJ(TYPE 'sales')
produces the following output.
VARIABLE
The statement
SHOW OBJ(DATA 'sales')
produces the following output.
DECIMAL
The statement
SHOW OBJ(DIMS 'sales')
produces the following output.
MONTH PRODUCT DISTRICT
The statement
SHOW OBJ(ISBY 'product' 'sales')
produces the following output.
YES
The statement
SHOW OBJ(LD 'sales')
produces the following output.
Sales Revenue
Example 8-51 Returning the Name of the Object or the Type of the Object
Suppose textvar
is a variable whose value is geog
, which is the name of a dimension. Whether you enclose the word textvar
in quotation marks determines whether the following OBJ
function calls return the word VARIABLE
(the type of object textvar
is) or DIMENSION
(the type of object geog
is).
SHOW OBJ(TYPE 'textvar') VARIABLE SHOW OBJ(TYPE textvar) DIMENSION
Example 8-52 Using OBJ to Select Objects
This example uses OBJ and DESCRIBE to look at the definitions of all the relations in an analytic workspace. The Oracle OLAP statements
LIMIT NAME TO OBJ(TYPE) EQ 'RELATION' DESCRIBE
produce the following output.
DEFINE REGION.DISTRICT RELATION REGION <DISTRICT> LD REGION for each DISTRICT DEFINE DIVISION.PRODUCT RELATION DIVISION <PRODUCT> LD DIVISION for each PRODUCT DEFINE MLV.MARKET RELATION MARKETLEVEL <MARKET> DEFINE MARKET.MARKET RELATION MARKET <MARKET> LD Self-relation for the Market Dimension
Example 8-53 Counting Compiled Objects
The following statements count how many compilable objects in your workspace are compiled and how many are not compiled. Each statement loops over the objects in the current workspace. The OBJ function returns YES
for each object that is compiled, NO
for each compilable object that is not compiled, and NA
for objects that are not compilable. When NASKIP is YES
(the default), the COUNT function in the first statement counts the number of YES
values that are returned by OBJ, and in the second statement it counts the number of NO
values that are returned.
SHOW COUNT(OBJ(ISCOMPILED)) SHOW COUNT(NOT OBJ(ISCOMPILED))
The following statement searches the compilable objects in the current workspace for references to the objects in all the attached workspaces. The output lists the non-compilable objects in the current workspace too, but the return value for them is NA
.
REPORT OBJ(REFERS OBJLIST(AW(LIST)))
In the following example, OBJ(REFERS)
tells you whether var1
, var2
, or var3
appears in the myprog
program. The return value of OBJ(REFERS)
is a multiline text value that contains the references it finds. When only var1
and var3
appear in the program, then the return value contains those two names, each on a separate line. The statement
SHOW OBJ(REFERS 'var1\nvar2\nvar3' 'myprog')
produces the following output.
VAR1 VAR3
When you do not specify the name of a program or formula to be searched, OBJ(REFERS) returns a single-line or multiline text value for each object in the NAME dimension of the current workspace. For objects that are not programs or formulas, NA
is returned. The statement
REPORT OBJ(REFERS 'var1\nvar2\nvar3')
produces the following output.
OBJ(REFERS 'var1 var2 NAME var3' ) -------------- ---------- PRODUCT NA DISTRICT NA DIVISION NA LINE NA QUARTER NA REGION NA YEAR NA MONTH NA ... MYPROG VAR1 VAR3 VAR1 NA VAR2 NA VAR3 NA
Example 8-55 OBJ with PROPERTY
In the following example, OBJ(PROPERTY) returns information about the decplace
property of the actual
variable. (See the PROPERTY command for more information.) The user created this property to store the number of decimal places and now wants to obtain that value to produce a report of the actual
variable.
The statements
CONSIDER actual PROPERTY 'decplace' 4 LIMIT month TO FIRST 1 LIMIT division TO 'Camping' REPORT ACROSS month W 20 DECIMAL OBJ(PROPERTY 'decplace' - 'actual') actual
produce the following output.
DIVISION: CAMPING -------ACTUAL------- -------MONTH-------- LINE JAN 95 -------------- -------------------- Revenue 533,362.8800 Cogs 360,810.6600 Gross.Margin 172,552.2200 Marketing 37,369.5000 Selling 89,007.3800 R.D 24,307.5000 Opr.Income 21,867.8400 Taxes 15,970.3900 Net.Income 5,897.4500
Example 8-56 OBJ with SEGWIDTH
The following statements show how to change and display segment size values for all of a variable's dimensions.
CHGDFN sales SEGWIDTH 150 5000 50 SHOW OBJ(SEGWIDTH ALL 'sales')
These statements produce the following output.
150 MONTH 5000 PRODUCT 50 DISTRICT
The following statement shows how to obtain the segment size value for a specific dimension.
SHOW OBJ(SEGWIDTH 'product' 'sales')
This statement produces the following output.
5000
The following statement shows how to obtain a list of segment sizes for every multidimensional variable or relation associated with the dimension.
When object-name is not specified, you must use REPORT rather than SHOW to obtain a value for each object in the NAME dimension.
REPORT OBJ(SEGWIDTH 'product')
This statement produces the following output.
NAME OBJ(SEGWIDTH 'product') -------------- ----------------------- SALES 5000 SALES.FORECAST 5000 SALES.PLAN 5000 SHARE 5000 UNITS 5000 UNITS.M 0 ...
The following statement shows how to produce a list of segment sizes for all dimensions in the current workspace.
REPORT OBJ(SEGWIDTH ALL)
This statement produces the following output.
NAME OBJ(SEGWIDTH ALL) -------------- ----------------- SALES 150 MONTH 5000 PRODUCT 50 DISTRICT SALES.FORECAST 150 MONTH 5000 PRODUCT 50 DISTRICT ...