Oracle9i OLAP Services Developer's Guide to the OLAP DML
Release 1 (9.0.1)

Part Number A86720-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

Working with Expressions, 5 of 14


Introducing Expressions

Definition: Expression

Expressions represent data values in the grammar of the OLAP DML language. You can use expressions as arguments in commands or functions and as values for OLAP DML options. An expression often performs a mathematical or logical operation. It always evaluates to a result in one of the OLAP DML data types.

An expression can be:

An expression has a data type. It can also have dimensions. The data type and dimensions of an expression depend on the values you are using in the expression.

Data types of expressions

The data type of an expression can be one of the following basic types:

These data types are defined in "OLAP DML Data Types".

How the data type of an expression is determined

The data type of an expression is the data type of the resulting value. It may not be the same as the data type of the OLAP DML data objects that make up the expression; it depends on the data and on the operators and functions that are involved.

In addition, a conditional expression that is indicated by an IF. . .THEN. . .ELSE operator is supported. A conditional expression returns a value whose data type depends on the expressions in the THEN and ELSE clauses, not on the expression in the IF clause, which must be Boolean.

Note: Do not confuse a conditional expression with the IF command, which has similar syntax but a different purpose. The IF command does not have a data type and is not evaluated like an expression.

Changing the data type of an expression

You can use the CONVERT function to change an expression's data type. For example, you can convert a number to text, or you can convert a text string that consists of digits to a number.

However, there is no need to convert data to another type within the same basic category because those conversions are made automatically. In general, you can use TEXT or ID data anywhere text is called for, and you can use integers and decimal numbers interchangeably.

OLAP DML data types are discussed in "OLAP DML Data Types".

Saving an expression

You can save an expression in a formula. Typically, you define a formula to save complex or frequently used expressions. A formula is a OLAP DML object that you name and define using the DEFINE FORMULA command.

For example, you can define a formula to calculate dollar sales, as follows.

define dollar.sales formula units * price

Each time you use a formula, the expression it represents is evaluated.

Related information

For more information, see the following table.

IF you want documentation about . . .  THEN see . . . 

functions, 

the OLAP DML Reference 

formulas, 

Chapter 7

the entry for the DEFINE FORMULA command in the OLAP DML Reference 

dimension status and limiting dimensions, 

Chapter 6

the entry for the LIMIT command in the OLAP DML Reference 

assigning permissions to dimension values, 

"Adding Security to an Analytic Workspace"

the entry for the PERMIT command in the OLAP DML Reference 

user-defined functions, 

Chapter 8 

qualified data references, 

"Specifying a Single Value for the Dimension of an Expression" 


Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback