Skip Headers

Oracle® OLAP DML Reference
10g Release 1 (10.1)

Part Number B10339-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to next page
Next
View PDF

CONTEXT function

The CONTEXT function lets you obtain information about object values that are saved in a context. You must first create the context with the CONTEXT command.

Return Value

The data type of the return value of the CONTEXT function depends on the arguments you provide. When you use the CONTEXT function without supplying any arguments, it returns a multiline text value that contains the names of all the contexts in the current session.

Syntax

CONTEXT ([context-name [UPDATE|name]])

Arguments

context-name

A text expression that contains the name of the context. Using the CONTEXT function with only the context-name returns a multiline text value that contains the names of all the objects saved in that context.

UPDATE

When you specify UPDATE with the CONTEXT function, the return value is the number of times values have been saved or dropped from the context.

name

The name of an object whose value is saved in the context. When you specify name with the CONTEXT function, the return value is the saved status or value of that object.

Notes


Persistence of a Context

A context exists only for the duration of an Oracle OLAP session. It is not an analytic workspace object and therefore cannot be saved as part of any analytic workspace.


Detached Analytic Workspaces

When a context contains saved values for objects in a particular analytic workspace, and you detach that analytic workspace, then Oracle OLAP removes those objects from the context. That context retains any saved values for Oracle OLAP options, as well as objects from other analytic workspaces that are still attached.

Examples

Example 9-17 Listing Context Names

In the following statement, the CONTEXT function returns the name of the only context in the current session. This is the same context used in "Saving Dimension Status".

SHOW CONTEXT

The statement produces the following output.

democontext1

Example 9-18 Listing Objects in a Context

In the following statement, the CONTEXT function returns the name of the only object included in the context named democontext1.

SHOW CONTEXT('democontext1')

The statement produces the following output.

PRODUCT

Example 9-19 Listing Saved Values

In the following statement, the CONTEXT function returns the values of the product dimension that are saved in the context named democontext1.

SHOW CONTEXT('democontext1' product)

The statement produces the following output.

Tents
Canoes