PK %Aoa,mimetypeapplication/epub+zipPK%AiTunesMetadata.plistM artistName Oracle Corporation book-info cover-image-hash 378192277 cover-image-path OEBPS/dcommon/oracle-logo.jpg package-file-hash 999093332 publisher-unique-id E23381-01 unique-id 982186147 genre Oracle Documentation itemName Oracle® OLAP Expression Syntax Reference, 11g Release 2 (11.2) releaseDate 2011-06-24T13:35:59Z year 2011 PKw*RMPK%AMETA-INF/container.xml PKYuPK%AOEBPS/row_functions032.htmo LEAST

LEAST

LEAST returns the smallest expression in a list of expressions. All expressions after the first are implicitly converted to the data type of the first expression before the comparison. Text expressions are compared character by character.

To retrieve the largest expression in a list of expressions, use GREATEST.

Return Value

The data type of the first expression

Syntax

LEAST(expr [, expr ]...)

Arguments

expr can be any expression.

Examples

LEAST('Harry','Harriot','Harold') returns the value Harold.

LEAST(19, 3, 7) returns the value 3.

PK toPK%AOEBPS/row_functions104.htm' UNISTR

UNISTR

UNISTR converts a text string to the national character set.

Return Value

NVARCHAR2

Syntax

UNISTR ( string )

Arguments

string can be any text expression. For portability, Oracle recommends using only ASCII characters and Unicode encoding values as text literals. A Unicode encoding value has the form \xxxx where xxxx is the hexadecimal value of a character. Supplementary characters are encoded as two code units, the first from the high-surrogates range (U+D800 to U+DBFF), and the second from the low-surrogates range (U+DC00 to U+DFFF). To include a literal backslash in the string, precede it with another backslash (\\).

Example

UNISTR('abc\00e5\00f1\00f6') returns the value abcåñö.

PKǴ, ' PK%AOEBPS/row_functions031.htm LAST_DAY

LAST_DAY

LAST_DAY returns the last day of the month in which a particular date falls.

Return Value

DATE

Syntax

LAST_DAY(date)

Arguments

date can be any datetime expression.

Example

LAST_DAY('26-MAR-06') returns the value 31-MAR-06.

PK$PK%AOEBPS/row_functions054.htma NUMTOYMINTERVAL

NUMTOYMINTERVAL

NUMTOYMINTERVAL converts a number to an INTERVAL YEAR TO MONTH data type.

Return Value

INTERVAL YEAR TO MONTH

Syntax

NUMTOYMINTERVAL(n, 'interval_unit')

Arguments

n can be any numeric expression.

interval_unit is a text expression that specifies the units. It must resolve to one of the following values:

These values are case insensitive.

Example

NUMTOYMINTERVAL(18, 'MONTH') returns the value +01-06.

PKܴjfaPK%AOEBPS/row_functions005.htmy ASCIISTR

ASCIISTR

ASCIISTR converts a string in any character set to ASCII in the database character set. Non-ASCII characters are represented as \xxxx, where xxxx is a UTF-16 code unit.

Return Value

VARCHAR2

Syntax

ASCIISTR(char)

Arguments

char can be any character string.

Example

ASCIISTR('Skåne') returns the value Sk\00E5ne.

PK PK%AOEBPS/olap_functions020.htmP OLAP_DML_EXPRESSION

OLAP_DML_EXPRESSION

OLAP_DML_EXPRESSION executes an expression in the OLAP DML language.

Return Value

The data type specified in the syntax

Syntax

OLAP_DML_EXPRESSION (expression, datatype)

Arguments

expression

An expression in the OLAP DML language, such as a call to a function or a program.

datatype

The data type of the return value from expression

Example

In this example, the OLAP_DML_EXPRESSION function executes the OLAP DML RANDOM function to generate a calculated measure with random numbers between 1.05 and 1.10.

OLAP_DML_EXPRESSION('RANDOM(1.05, 1.10)', NUMBER)

TimeProductRandom
2005Hardware1.07663806
2005Software/Other1.08295738
2006Hardware1.08707305
2006Software/Other1.09730881

PK PK%AOEBPS/row_functions035.htm. LNNVL

LNNVL

LNNVL evaluates a condition when one or both operands of the condition may be null. LNNVL can be used anywhere a scalar expression can appear, even in contexts where the IS [NOT] NULL, AND, or OR conditions are not valid but would otherwise be required to account for potential nulls.

NOTE: This function returns 1 (true) if the condition is false or unknown, and 0 (false) if the condition is true.

Return Value

NUMBER

Syntax

LNNVL(condition)

Arguments

condition can be any expression containing scalar values.

Examples

LNNVL(1 > 4) returns 1 (true).

PK5PK%AOEBPS/row_functions090.htmo TO_DSINTERVAL

TO_DSINTERVAL

TO_DSINTERVAL converts a text expression to an INTERVAL DAY TO SECOND data type.

Return Value

INTERVAL DAY TO SECOND

Syntax

TO_DSINTERVAL(char)

Arguments

char is a text expression to be converted.

Example

TO_DSINTERVAL('360 12:45:49') returns the value +360 12:45:49.000000.

PK6'bKtoPK%AOEBPS/row_functions100.htm TRIM

TRIM

TRIM removes leading or trailing characters (or both) from a character string.

Return Value

VARCHAR2

Syntax

TRIM([ { { LEADING | TRAILING | BOTH }[ trim_character ]  
       | trim_character
       }
       FROM 
     ]
     trim_source
    )

Arguments

LEADING removes matching characters from the beginning of the string.

TRAILING removes matching characters from the end of the string.

BOTH removes matching characters from both the beginning and the end of the string. (Default)

trim_character is a single character to be removed. By default, it is a space.

trim_source is the text expression to be trimmed.

Examples

TRIM('0' FROM '00026501.6703000') returns the value 26501.6703.

TRIM(LEADING '!' FROM '!!Help! Help!!') returns the value Help! Help!! .

PKV>  PK%AOEBPS/row_functions013.htm CHARTOROWID

CHARTOROWID

CHARTOROWID converts a value from a text data type to a ROWID data type.

For more information about the ROWID pseudocolumn, refer to the Oracle Database SQL Language Reference.

Return Value

ROWID

Syntax

CHARTOROWID(char)

Arguments

char is a text expression that forms a valid rowid.

Example

chartorowid('AAAN6EAALAAAAAMAAB') returns the text string AAAN6EAALAAAAAMAAB as a rowid.

PKzPK%AOEBPS/cover.htmO Cover

Oracle Corporation

PK[pTOPK%AOEBPS/row_functions019.htm{ CURRENT_DATE

CURRENT_DATE

CURRENT_DATE returns the current date in the session time zone.

Return Value

DATE

Syntax

CURRENT_DATE

Example

CURRENT_DATE returns a value such as 12-AUG-08.

PK"PK%AOEBPS/row_functions017.htmC COS

COS

COS calculates the cosine of an angle.

Return Value

NUMBER

Syntax

COS(n)

Arguments

n is a numeric expression for an angle represented in radians.

Example

COS(180 * 3.1415927/180) returns the cosine of 180 degrees as the value -1. The expression converts degrees to radians.

PKHCPK%AOEBPS/row_functions105.htmz UPPER

UPPER

UPPER converts all alphabetic characters in a text expression to uppercase. The data type of the return value is the same as the original text.

Return Value

CHAR | NCHAR | VARCHAR2 | NVARCHAR2

Syntax

UPPER(char)

Arguments

char can be any text expression.

Example

UPPER('This is an emergency') returns the string THIS IS AN EMERGENCY.

PK}֪PK%AOEBPS/row_functions061.htmJ REGEXP_INSTR

REGEXP_INSTR

REGEXP_INSTR searches a string for a regular pattern. It can return an integer indicating either the beginning or the ending position of the matched substring. If no match is found, the function returns 0.

The function evaluates strings using characters as defined by the input character set.

Return Value

NUMBER

Syntax

REGEXP_INSTR (source_char, pattern
              [, position
                 [, occurrence
                    [, return_option
                       [, match_parameter ]
                    ]
                 ]
              ]
             )

Arguments

source_char is the text expression to search.

pattern is the string to search for. A period matches any character. For a list of operators, refer to the Oracle Database SQL Language Reference, Appendix D, Oracle Regular Expression Support.

position is a nonzero integer indicating the character of source_char where the function begins the search. When position is negative, then the function counts and searches backward from the end of string. The default value of position is 1, which means that the function begins searching at the first character of source_char.

occurrence is an integer indicating which occurrence of pattern the function should search for. The value of occurrence must be positive. The default values of occurrence is 1, meaning the function searches for the first occurrence of pattern.

return_option is either 0 to return the position of the match (default), or 1 to return the position of the character following the match.

match_parameter is a text literal that lets you change the default matching behavior of the function. You can specify one or more of the following values:

Example

REGEXP_INSTR('Mississippi', 'i', 1, 3) searches the string Mississippi for the third instance of the letter i, beginning the search at the first letter. It returns the value 8.

PKOJPK%AOEBPS/row_functions084.htm0 TO_BINARY_DOUBLE

TO_BINARY_DOUBLE

TO_BINARY_DOUBLE converts a text or numeric expression to a double-precision floating-point number.

Return Value

BINARY_DOUBLE

Syntax

TO_BINARY_DOUBLE (expr [, fmt [, 'nlsparam' ] ])

Arguments

n can be any text or numeric expression.

fmt is a text expression that identifies a number format model as described in the Oracle Database SQL Language Reference.

nlsparam specifies the characters used by these number format elements:

This argument has the format shown here:

'NLS_NUMERIC_CHARACTERS = ''dg''
 NLS_CURRENCY = ''text''
 NLS_ISO_CURRENCY = territory '

The d is the decimal character, and the g is the group separator. They must be different single-byte characters. Within the quoted string, use two single quotation marks around the parameter values. Ten characters are available for the currency symbol.

If you omit this argument or any of the NLS parameters, then this function uses the default values for your session to interpret expr.

Example

All of these examples return the value 1.235E+003:

TO_BINARY_DOUBLE(1234.56)

TO_BINARY_DOUBLE('$1,234.56', '$9,999.99')

TO_BINARY_DOUBLE('1.234,56', '9G999D99', 'NLS_NUMERIC_CHARACTERS='',.''')
PK\65 0 PK%AOEBPS/row_functions053.htmT NUMTODSINTERVAL

NUMTODSINTERVAL

NUMTODSINTERVAL converts a number to an INTERVAL DAY TO SECOND data type.

Return Value

INTERVAL DAY TO SECOND

Syntax

NUMTODSINTERVAL(n, 'interval_unit')

Arguments

n can be any numeric expression.

interval_unit is a text expression that specifies the units. It must resolve to one of the following values:

These values are case insensitive.

Example

NUMTODSINTERVAL(100, 'MINUTE') returns the value +00 01:40:00.000000.

PK%ٰPK%AOEBPS/row_functions076.htm SOUNDEX

SOUNDEX

SOUNDEX returns a character string containing the phonetic representation of a text expression. This function lets you compare words that are spelled differently but sound alike.

The function is based on the algorithm described in Donald Knuth's The Art of Computer Programming. This algorithm was designed specifically for English. Its results for other languages other than English are unpredictable and typically unsatisfactory.

Return Value

VARCHAR2

Syntax

SOUNDEX (char)

Arguments

char can be any text expression.

Example

All of these examples return the value D500:

soundex('Donna')

soundex('Diane')

soundex('Dana')
PK<PK%AOEBPS/row_functions040.htmr LTRIM

LTRIM

LTRIM scans a text expression from left to right and removes all the characters that match the characters in the trim expression, until it finds an unmatched character. The data type of the return value is the same as the original text.

Return Value

CHAR | NCHAR | VARCHAR2 | NVARCHAR2

Syntax

LTRIM(char [, set ])

Arguments

char is the text expression to be trimmed.

set is a text expression with the characters to remove. The default value of set is a single blank.

Examples

LTRIM(' . . . .Last Word', ' .') returns the value Last Word.

PKVwrPK%AOEBPS/row_functions015.htmh COALESCE

COALESCE

COALESCE returns the first non-null expression in a list of expressions, or null when all of the expressions evaluate to null.

Return Value

Data type of the first argument

Syntax

COALESCE(expr [, expr ]...) 

Arguments

expr can be any expression.

Examples

COALESCE(5, 8, 3) returns the value 5.

COALESCE(NULL, 8, 3) returns the value 8.

PK.2PK%AOEBPS/row_functions044.htm' NEW_TIME

NEW_TIME

NEW_TIME converts the date and time from one time zone to another. Before using this function, set the NLS_DATE_FORMAT parameter to display 24-hour time.

Return Value

DATE

Syntax

NEW_TIME(date, timezone1, timezone2)

Arguments

date is a datetime expression to be converted to a new time zone.

timezone1 is the time zone of date.

timezone2 is the new time zone.

The time zone arguments are limited to the values inTable 3-2. For other time zones, use FROM_TZ.

Table 3-2 Time Zones

Time ZoneAbbreviation

Alaska-Hawaii Daylight Time

HDT

Alaska-Hawaii Standard Time

HST

Atlantic Daylight Time

ADT

Atlantic Standard Time

AST

Bering Daylight Time

BDT

Bering Standard Time

BST

Central Daylight Time

CDT

Central Standard Time

CST

Eastern Daylight Time

EDT

Eastern Standard Time

EST

Greenwich Mean Time

GMT

Mountain Daylight Time

MDT

Mountain Standard Time

MST

Newfoundland Standard Time

NST

Pacific Daylight Time

PDT

Pacific Standard Time

PST

Yukon Daylight Time

YDT

Yukon Standard Time

YST


Example

NEW_TIME(SYSDATE, 'PST', 'EST') returns a value such as 18-JAN-07 04:38:07 in Eastern Standard Time when SYSDATE is 18-JAN-07 01:38:07 in Pacific Standard Time. For this example, NLS_DATE_FORMAT is set to DD-MON-RR HH:MI:SS.

PK1,'PK%AOEBPS/olap_functions007.htmG HIER_DEPTH

HIER_DEPTH

HIER_DEPTH returns a number representing the level depth of either all members of a hierarchy or a particular member, where 0 is the top level. The hierarchy can be either level-based or value-based.

Return Value

NUMBER

Syntax

HIER_DEPTH ( 
   [member_expression] [WITHIN]
   {DIMENSION dimension_id | HIERARCHY hierarchy_id} ) 

Arguments

member_expression

Identifies a single dimension member within the hierarchy used for the calculation. If this optional argument is specified, then the result does not vary across dimension members.

dimension_id

The dimension over which the values are calculated using the default hierarchy.

hierarchy_id

The hierarchy over which the values are calculated. If dimension_id is used instead, the default hierarchy is used.

Example

This example returns the depth of each member in the default hierarchy of the Time dimension.

HIER_DEPTH(DIMENSION "TIME")

TimeDepth
20061
Q1.062
Q2.062
Q3.062
Q4.062
JAN-063
FEB-063
MAR-063
APR-063
MAY-063
JUN-063
JUL-063
AUG-063
SEP-063
OCT-063
NOV-063
DEC-063

The next example returns 2 as the depth of Italy in the default Customer hierarchy.

HIER_DEPTH('ITA' WITHIN DIMENSION CUSTOMER)

PKY-LGPK%AOEBPS/olap_functions015.htm=& LEAD

LEAD

LEAD returns the value of an expression for a later time period.

Return Value

The same data type as the value expression

Syntax

LEAD (lead_args) OVER (lead_clause)

lead_args::=

expression, offset [, {default_expression | CLOSEST} ]

lead_clause::=

[ {DIMENSION dimension_id | HIERARCHY hierarchy_id} ]
[ [BY] { LEVEL 
       | PARENT 
       | GREGORIAN {YEAR | QUARTER | MONTH | WEEK | DAY}
       | ANCESTOR AT { DIMENSION LEVEL dim_level_id
                      | HIERARCHY LEVEL hier_level_id
                      }
       }
                [POSITION FROM {BEGINNING | END}] 
] 

Arguments

expression

A dimensional expression whose values you want to calculate.

offset

A numeric expression for the number of periods to count forward from the current time period.

default_expression

The value returned when offset does not identify a valid period. This clause is either an expression of any data type or the CLOSEST keyword for the closest match. The closest match is the first member when counting forward.

dimension_id

The Time dimension over which the lead is calculated.

hierarchy_id

The hierarchy over which the lead is calculated. Otherwise, the default hierarchy for dimension_id is used.

dim_level_id

The name of a level of dimension_id.

hier_level_id

The name of a level of hierarchy_id.

BY subclause

The BY subclause identifies the range of time periods used when counting the offset. Following are descriptions of the keywords:

Offset UnitDescription
LEVELThe member at the same level offset periods after the current member. (Default)
PARENTThe member at the same level with the same parent offset periods after the current member.
GREGORIAN YEARThe period at the same level with a start date exactly offset years after the start date of the current period.
GREGORIAN QUARTERThe period at the same level with a start date exactly offset quarters after the start date of the current period.
GREGORIAN MONTHThe period at the same level with a start date exactly offset months after the start date of the current period.
GREGORIAN WEEKThe period at the same level with a start date exactly offset weeks after the start date of the current period.
GREGORIAN DAYThe period at the same level with a start date exactly offset days after the start date of the current period.
ANCESTORThe period at the same level as the current period and whose ancestor is offset positions after the ancestor of the current period.

Examples

This calculation returns the value of the next time period based on calendar quarter. The sample output from this calculation appears in the Next Qtr column.

LEAD (GLOBAL.UNITS_CUBE.UNITS, 1, CLOSEST) OVER (DIMENSION GLOBAL.TIME BY ANCESTOR AT DIMENSION LEVEL GLOBAL.TIME.CALENDAR_QUARTER)

TimeParentUnitsNext Qtr
2005TOTAL565718--
Q1-05CY2005143607138096
Q2-05CY2005138096138953
Q3-05CY2005138953145062
Q4-05CY2005145062146819
Jan-05CY2005.Q15009840223
Feb-05CY2005.Q14399045477
Mar-05CY2005.Q14951952396
Apr-05CY2005.Q24022345595
May-05CY2005.Q24547746882
Jun-05CY2005.Q25239646476
Jul-05CY2005.Q34559547476
Aug-05CY2005.Q34688247496
Sep-05CY2005.Q34647650090
Oct-05CY2005.Q44747647776
Nov-05CY2005.Q44749647695
Dec-05CY2005.Q45009051348

Related Topics

LAG, LEAD_VARIANCE, LEAD_VARIANCE_PERCENT

PKx==PK%AOEBPS/olap_functions004.htm)Z DENSE_RANK

DENSE_RANK

DENSE_RANK orders the members of a dimension based on the values of an expression. The function returns the sequence numbers of the dimension members.

DENSE_RANK assigns the same minimum rank to identical values, and returns the results in a sequential list. The result may be fewer ranks than values in the series. For example, DENSE_RANK may return 1, 2, 3, 3, 4 for a series of five dimension members.

Return Value

NUMBER

Syntax

DENSE_RANK ( ) OVER (rank_clause)

rank_clause::=

{ DIMENSION dimension_id | HIERARCHY hierarchy_id }
  ORDER BY order_by_clause [, order_by_clause]...
  [ WITHIN { LEVEL 
            | PARENT 
            | ANCESTOR AT { DIMENSION LEVEL dim_lvl_id
                           | HIERARCHY LEVEL hier_level_id
                           }
            }
  ]

order_by_clause::=

expression [ASC | DESC] [NULLS {FIRST | LAST}] 

Arguments

dimension_id

The dimension over which the values are calculated using the default hierarchy.

hierarchy_id

The hierarchy over which the values are calculated. If dimension_id is used instead, the default hierarchy is used.

ORDER BY

Provides the basis for the ranking. You can provide additional ORDER BY clauses to break any ties in the order.

expression

Provides the values to use as the basis for the rankings.

ASC | DESC

Sorts the ranking from smallest to largest (ascending) or from largest to smallest (descending).

NULLS {FIRST | LAST}

Determines whether members with null values are listed first or last.

WITHIN

Selects a set of related dimension members to be ranked.

LEVEL ranks all members at the same level.

PARENT ranks members at the same level with the same parent.

ANCESTOR ranks all members at the same level and with the same ancestor at a specified level.

dim_level_id

The name of a level of dimension_id.

hier_level_id

The name of a level of hierarchy_id.

Example

This example ranks time periods within a calendar year by Unit Cost, using the default Calendar hierarchy. Notice that although two months (JAN-02 and JUL-02) have the same value and the same rank (6), the ranking continues at 7 for JUN-02.

DENSE_RANK() OVER (DIMENSION "TIME" ORDER BY PRICE_CUBE.UNIT_COST DESC NULLS LAST WITHIN ANCESTOR AT DIMENSION LEVEL TIME.CALENDAR_YEAR)

ProductTimeCostDense Rank
Deluxe MouseMAR-0224.051
Deluxe MouseAPR-0223.952
Deluxe MouseFEB-0223.943
Deluxe MouseAUG-0223.884
Deluxe MouseMAY-0223.845
Deluxe MouseJAN-0223.736
Deluxe MouseJUL-0223.736
Deluxe MouseJUN-0223.727
Deluxe MouseSEP-0223.718
Deluxe MouseNOV-0223.659
Deluxe MouseDEC-0223.6210
Deluxe MouseOCT-0223.3711

Related Topics

AVERAGE_RANK, RANK, ROW_NUMBER

PKqj0))PK%AOEBPS/olap_functions013.htmH0 LAG_VARIANCE

LAG_VARIANCE

LAG_VARIANCE returns the difference between values for the current time period and an earlier period.

Return Value

The same data type as the value expression

Syntax

LAG_VARIANCE (lag_args) OVER (lag_clause)

lag_args::=

expression, offset [, {default_expression | CLOSEST} ]

lag_clause::=

[ {DIMENSION dimension_id | HIERARCHY hierarchy_id} ]
[ [BY] { LEVEL 
       | PARENT 
       | GREGORIAN {YEAR | QUARTER | MONTH | WEEK | DAY}
       | ANCESTOR AT { DIMENSION LEVEL dim_level_id
                      | HIERARCHY LEVEL hier_level_id
                      }
       }
                [POSITION FROM {BEGINNING | END}] 
] 

Arguments

expression

A dimensional expression whose values you want to calculate.

offset

A numeric expression for the number of periods to count back from the current time period.

default_expression

The value returned when offset does not identify a valid period. This clause is either an expression of any data type or the CLOSEST keyword for the closest match. The closest match is the first member when counting back.

dimension_id

The Time dimension over which the lag is calculated.

hierarchy_id

The hierarchy over which the lag is calculated. Otherwise, the default hierarchy for dimension_id is used.

dim_level_id

The name of a level of dimension_id.

hier_level_id

The name of a level of hierarchy_id.

BY subclause

The BY subclause identifies the range of time periods used when counting the offset. Following are descriptions of the keywords:

Offset UnitDescription
LEVELThe member at the same level offset periods before the current member. (Default)
PARENTThe member at the same level with the same parent offset periods before the current member.
GREGORIAN YEARThe period at the same level with a start date exactly offset years before the start date of the current period.
GREGORIAN QUARTERThe period at the same level with a start date exactly offset quarters before the start date of the current period.
GREGORIAN MONTHThe period at the same level with a start date exactly offset months before the start date of the current period.
GREGORIAN WEEKThe period at the same level with a start date exactly offset weeks before the start date of the current period.
GREGORIAN DAYThe period at the same level with a start date exactly offset days before the start date of the current period.
ANCESTORThe period at the same level as the current period and whose ancestor is offset positions before the ancestor of the current period.

Examples

This example returns the difference in values between the current period and the equivalent period in the prior year.

LAG_VARIANCE (GLOBAL.UNITS_CUBE.UNITS, 1) OVER (HIERARCHY GLOBAL.TIME.CALENDAR ANCESTOR AT DIMENSION LEVEL GLOBAL.TIME.CALENDAR_YEAR)

TimeUnitsLast YearDifference
Q1.05143607146529-2922
Q2.05138096143070-4974
Q3.05138953148292-9339
Q4.05145062149528-4466
Q1.061468191436073212
Q2.061452331380967137
Q3.061435721389534619
Q4.061493051450624243

Related Topics

LAG, LAG_VARIANCE_PERCENT, LEAD

PK<8M0H0PK%AOEBPS/title.htm> Oracle OLAP Expression Syntax Reference, Release 11.2

Oracle® OLAP

Expression Syntax Reference

Release 11.2

E23381-01

June 2011


Oracle OLAP Expression Syntax Reference, Release 11.2

E23381-01

Copyright © 2006, 2011, Oracle and/or its affiliates. All rights reserved.

Primary Author: Donna Carver 

Contributor: David Greenfield, Anne Murphy, Martin Roth, Fuad Sheehab 

This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.

The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.

If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice is applicable:

U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data delivered to U.S. Government customers are "commercial computer software" or "commercial technical data" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, duplication, disclosure, modification, and adaptation shall be subject to the restrictions and license terms set forth in the applicable Government contract, and, to the extent applicable by the terms of the Government contract, the additional rights set forth in FAR 52.227-19, Commercial Computer Software License (December 2007). Oracle America, Inc., 500 Oracle Parkway, Redwood City, CA 94065.

This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications.

Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group.

This software or hardware and documentation may provide access to or information on content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services.

PKj|C>PK%AOEBPS/row_functions079.htmU; SYS_CONTEXT

SYS_CONTEXT

SYS_CONTEXT returns the value of an attribute of a named context. The context, attribute, and value must already be defined in the database. If the context is not defined, SYS_CONTEXT returns NULL.

Return Value

VARCHAR2

Syntax

SYS_CONTEXT ('namespace', 'parameter')

Arguments

namespace can be any named context in the database. USERENV is a built-in context that describes the current session.

parameter is a defined attribute of namespace. Table 3-3 describes the predefined attributes of USERENV that are most likely to have values. For a complete list, refer to the SYS_CONTEXT entry in the Oracle Database SQL Language Reference.

Table 3-3 USERENV Attributes

USERENV AttributeDescription

AUTHENTICATED_IDENTITY

The identity used for authentication, such as database user name, schema name, or operating system login name.

AUTHENTICATION_METHOD

The method of authentication, such as PASSWORD, OS, or SSL.

CURRENT_EDITION_ID

The session edition identifier, such as 100.

CURRENT_EDITION_NAME

The session edition name, such as ORA$BASE.

CURRENT_SCHEMA

The name of the currently active default schema, such as SH.

CURRENT_SCHEMA_ID

The numeric identifier of the currently active default schema, such as 80.

CURRENT_USER

The name of the database user whose privileges are currently active, such as SH.

CURRENT_USERID

The numeric identifier of the database user whose privileges are currently active, such as 80.

DATABASE_ROLE

Data Guard role of the database: PRIMARY, PHYSICAL STANDBY, LOGICAL STANDBY, or SNAPSHOT STANDBY.

DB_DOMAIN

The network domain of the database as specified by the DB_DOMAIN initialization parameter, such as us.example.com.

DB_NAME

The name of the database as specified by the DB_NAME initialization parameter.

DB_UNIQUE_NAME

The unique name of the database within the domain as specified by the DB_UNIQUE_NAME initialization parameter.

ENTERPRISE_IDENTITY

The enterprise-wide identity of the user, or NULL for local users, SYSDBA, and SYSOPER.

FG_JOB_ID

Job identifier of the current session if a client foreground process opened it; otherwise, NULL.

GLOBAL_CONTEXT_MEMORY

The number used in the System Global Area by the globally accessed context.

GLOBAL_UID

The global user identification from Oracle Internet Directory for Enterprise User Security logins; otherwise, NULL.

HOST

The name of the client host computer.

IDENTIFICATION_TYPE

The way the user schema was created in the database: LOCAL, EXTERNAL, GLOBAL SHARED, or GLOBAL PRIVATE.

INSTANCE

The identification number of the current instance, such as 1.

INSTANCE_NAME

The name of the database instance.

IP_ADDRESS

The IP address of the client, such as 10.255.255.255.

ISDBA

TRUE if the user was authenticated with DBA privileges; otherwise, FALSE.

LANG

A short name for the session language, such as US for AMERICAN.

LANGUAGE

The language, territory, and database character set in the form language_territory.characterset, such as AMERICA_AMERICAN.WE8DEC.

MODULE

The application name set through the DBMS_APPLICATION_INFO package or OCI, such as JDBC Thin Client or SQL Developer.

NETWORK_PROTOCOL

The network protocol being used for communication, such as TCP.

NLS_CALENDAR

The session calendar, such as GREGORIAN.

NLS_CURRENCY

The session currency mark, such as $.

NLS_DATE_FORMAT

The session date format, such as DD-MON-RR.

NLS_DATE_LANGUAGE

The session date language, such as AMERICAN.

NLS_SORT

BINARY or a linguistic sort basis, such as XSPANISH.

NLS_TERRITORY

The session territory, such as AMERICA.

OS_USER

The operating system user name of the client process that initiated the database session.

SERVER_HOST

The host name of the computer where the database instance is running.

SERVICE_NAME

The name of the service the session is connected to., such as SYS$USERS.

SESSION_USER

The database user name or schema name that identified the user at login, such as SH.

SESSIONID

The session identifier, such as 120456.

SID

The session number, such as 86.


Example

SYS_CONTEXT('USERENV','NLS_DATE_FORMAT') returns a value such as DD-MON-RR.

PKu@Z;U;PK%AOEBPS/row_functions033.htm! LENGTH

LENGTH

The LENGTH functions return the length of a text expression.

Return Value

NUMBER

Syntax

{ LENGTH | LENGTHB | LENGTHC }(char)

Arguments

char is any text expression.

Example

LENGTH('CANDIDE') returns the value 7.

PK&!PK%AOEBPS/row_functions102.htmr TZ_OFFSET

TZ_OFFSET

TZ_OFFSET returns the time zone offset from Coordinated Universal Time (UTC).

Return Value

VARCHAR2

Syntax

TZ_OFFSET({ 'time_zone_name' | '{ + | - } hh:mi'
          | SESSIONTIMEZONE | DBTMEZONE
          }
         )

Arguments

time_zone_name is the name of a time zone.

hh:mm are hours and minutes. This argument simply returns itself.

SESSIONTIMEZONE returns the session time zone.

DBTIMEZONE returns the database time zone.

Examples

TZ_OFFSET('US/Eastern') returns the offset -04:00 during Daylight Savings Time.

TZ_OFFSET('EST') returns the offset -05:00.

TZ_OFFSET(DBTIMEZONE) returns the offset -07:00 for Mountain Standard Time.

PKw r PK%AOEBPS/row_functions024.htm' EXTRACT (datetime)

EXTRACT (datetime)

EXTRACT returns the value of a specified field from a datetime or interval expression.

Return Value

NUMBER

Syntax

EXTRACT( { { YEAR
           | MONTH
           | DAY
           | HOUR
           | MINUTE
           | SECOND
           }
         | { TIMEZONE_HOUR
           | TIMEZONE_MINUTE
           }
         | { TIMEZONE_REGION
           | TIMEZONE_ABBR
           }
         }
    FROM   { datetime_value_expression
           | interval_value_expression
           }
       )

Arguments

datetime_value_expression is an expression with a datetime data type.

interval_value_expression is an expression with an interval data type.

Example

EXTRACT(MONTH FROM CURRENT_TIMESTAMP) returns the value 8 for August when the current timestamp is 08-AUG-06 01.10.55.330120 PM -07:00.

EXTRACT(TIMEZONE_HOUR FROM CURRENT_TIMESTAMP) returns the value -7 from the same example.

PKRXB, ' PK%AOEBPS/row_functions021.htmG DBTIMEZONE

DBTIMEZONE

DBTIMEZONE returns the value of the database time zone as either a time zone offset from Coordinated Universal Time (UTC) or a time zone region name.

To obtain other time zone offsets, use TZ_OFFSET.

Return Value

VARCHAR2

Syntax

DBTIMEZONE

Example

DBTIMEZONE returns the offset -08:00 for Mountain Standard Time.

PKӲÍLGPK%AOEBPS/row_functions047.htm NLS_CHARSET_NAME

NLS_CHARSET_NAME

NLS_CHARSET_NAME returns the name corresponding to a specified character set number.

Return Value

VARCHAR2

Syntax

NLS_CHARSET_NAME (charset_id)

Arguments

charset_id is a valid character set number or one of these keywords:

If the number does not correspond to a character set, then the function returns NULL.

Example

NLS_CHARSET_NAME(2000) returns the value AL16UTF16.

PKm  PK%AOEBPS/row_functions046.htm~ NLS_CHARSET_ID

NLS_CHARSET_ID

NLS_CHARSET_ID returns the identification number corresponding to a specified character set name.

Return Value

NUMBER

Syntax

NLS_CHARSET_ID  ( charset_name )

Arguments

charset_name is a VARCHAR2 expression that is a valid character set name.

Example

NLS_CHARSET_ID('AL32UTF8') returns the value 873.

PKk8~PK%AOEBPS/olap_functions008.htm] HIER_LEVEL

HIER_LEVEL

HIER_LEVEL returns the level of either all members of a hierarchy or a particular member. The hierarchy must be level-based.

Return Value

VARCHAR2

Syntax

HIER_LEVEL ( 
   [member_expression] [WITHIN]
   {DIMENSION dimension_id | HIERARCHY hierarchy_id} ) 

Arguments

member_expression

Identifies a single dimension member within the hierarchy used for the calculation. If this optional argument is specified, then the result does not vary across dimension members.

dimension_id

The dimension over which the values are calculated using the default hierarchy.

hierarchy_id

The hierarchy over which the values are calculated. If dimension_id is used instead, the default hierarchy is used.

Example

This example returns the level of each member of the default hierarchy of the Time dimension.

HIER_LEVEL(DIMENSION "TIME")

TimeLevel
2006CALENDAR_YEAR
Q1.06CALENDAR_QUARTER
Q2.06CALENDAR_QUARTER
Q3.06CALENDAR_QUARTER
Q4.06CALENDAR_QUARTER
JAN-06MONTH
FEB-06MONTH
MAR-06MONTH
APR-06MONTH
MAY-06MONTH
JUN-06MONTH
JUL-06MONTH
AUG-06MONTH
SEP-06MONTH
OCT-06MONTH
NOV-06MONTH
DEC-06MONTH

The next example returns ACCOUNT as the level of Business World in the Market hierarchy of the Customer dimension.

HIER_LEVEL('BUSN WRLD' WITHIN HIERARCHY CUSTOMER.MARKET)

PKPK%AOEBPS/row_functions018.htm COSH

COSH

COSH calculates the cosine of a hyperbolic angle.

Return Value

NUMBER

Syntax

COSH(n)

Arguments

n is a numeric expression for a hyperbolic angle.

Example

COSH(0) returns the value 1.

PKJPPK%AOEBPS/row_functions038.htmw LOWER

LOWER

LOWER converts all alphabetic characters in a text expression to lowercase. The data type of the return value is the same as the original text.

Return Value

CHAR | NCHAR | VARCHAR2 | NVARCHAR2

Syntax

LOWER(char)

Arguments

char can be any text expression.

Example

LOWER('STOP SHOUTING') returns the string stop shouting.

PK?h|wPK%AOEBPS/row_functions071.htm4 RTRIM

RTRIM

RTRIM scans a text expression from right to left and removes all the characters that match the characters in the trim expression, until it finds an unmatched character. The data type of the return value is the same as the original text.

Return Value

CHAR | NCHAR | VARCHAR2 | NVARCHAR2

Syntax

RTRIM(char [, set ])

Arguments

char is the text expression to be trimmed.

set is a text expression with the characters to remove. The default value of set is a single blank.

Examples

RTRIM('You did that!?!?!?!', '?!') returns the value You did that.

RTRIM('3.14848', '84') returns the text value 3.1.

PKA PK%AOEBPS/olap_functions018.htm0 MAX

MAX

MAX returns the largest of a selection of data values calculated over a Time dimension.

The GREGORIAN relations superimpose the Gregorian calendar on the Time dimension. These relations can be useful for calculations on fiscal and nonstandard hierarchies.

Return Value

NUMBER

Syntax

MAX (value_expr) OVER (window_clause)

window_clause::=

[ { DIMENSION dimension_id | HIERARCHY hierarchy_id } ]
    BETWEEN preceding_boundary | following_boundary 
     [WITHIN { PARENT
              | LEVEL
              | GREGORIAN {YEAR | QUARTER | MONTH | WEEK}
              | ANCESTOR AT { DIMENSION LEVEL dim_level_id
                             | HIERARCHY LEVEL hier_level_id 
                             }
              }
     ]

preceding_boundary::=

{UNBOUNDED PRECEDING | expression PRECEDING} AND 
   { CURRENT MEMBER 
   | expression {PRECEDING | FOLLOWING}
   | UNBOUNDED FOLLOWING
   }

following_boundary::=

{CURRENT MEMBER | expression FOLLOWING} AND
  { expression FOLLOWING 
  | UNBOUNDED FOLLOWING
  }

Arguments

value_expr

A dimensional expression whose values you want to calculate.

dimension_id

The Time dimension over which the values are calculated using the default hierarchy.

hierarchy_id

The hierarchy over which the values are calculated. If dimension_id is used instead, the default hierarchy is used.

dim_level_id

The name of a level of dimension_id.

hier_level_id

The name of a level of hierarchy_id.

boundaries

The preceding_boundary and following_boundary identify a range of time periods within the group identified by the dimension or hierarchy.

UNBOUNDED starts with the first period or ends with the last period of the group.

CURRENT MEMBER starts or ends the calculation at the current time period.

expression

A numeric value identifying a period at a particular distance from the current time period that starts or ends the range.

WITHIN subclause

Identifies the range of time periods used in the calculation. Following are descriptions of the keywords.

RangeDescription
LEVELCalculates all time periods at the same level. (Default)
PARENTCalculates time periods at the same level with the same parent.
GREGORIAN YEARCalculates time periods within the same Gregorian year.
GREGORIAN QUARTERCalculates time periods within the same Gregorian quarter.
GREGORIAN MONTHCalculates time periods within the same Gregorian month.
GREGORIAN WEEKCalculates time periods within the same Gregorian week.
ANCESTORIncludes time periods at the same level and with the same ancestor at a specified level.

Example

This example calculates a moving maximum within the calendar year.

MAX(GLOBAL.UNITS_CUBE.UNITS) OVER (DIMENSION GLOBAL.TIME BETWEEN UNBOUNDED PRECEDING AND CURRENT MEMBER WITHIN ANCESTOR AT DIMENSION LEVEL GLOBAL.TIME.CALENDAR_YEAR)

TimeUnitsMaximum
JAN-064777647776
FEB-064769547776
MAR-065134851348
APR-064700551348
MAY-065280952809
JUN-064541952809
JUL-064838852809
AUG-064883052809
SEP-064635452809
OCT-064741152809
NOV-064684252809
DEC-065505255052

Related Topics

AVG, COUNT, MIN, SUM

PKo00PK%AOEBPS/row_functions027.htm~ GREATEST

GREATEST

GREATEST returns the largest expression in a list of expressions. All expressions after the first are implicitly converted to the data type of the first expression before the comparison. Text expressions are compared character by character.

To retrieve the smallest expression in a list of expressions, use LEAST.

Return Value

The data type of the first expression

Syntax

GREATEST(expr [, expr ]...)

Arguments

expr can be any expression.

Examples

GREATEST('Harry','Harriot','Harold') returns the value Harry.

GREATEST(7, 19, 3) returns the value 19.

PK)PK%AOEBPS/row_functions052.htm7 NULLIF

NULLIF

NULLIF compares one expression with another. It returns NULL when the expressions are equal, or the first expression when they are not.

Return Value

Data type of the first argument

Syntax

NULLIF(expr1, expr2)

Arguments

expr1 is the base expression. It cannot be a literal null.

expr2 is the expression to compare with the base expression.

Example

NULLIF('red', 'Red') returns the value red.

PK#PK%AOEBPS/row_functions.htmO Row Functions

3 Row Functions

The OLAP row functions extend the syntax of the SQL row functions for use with dimensional objects. If you use the SQL row functions, then this syntax is familiar. You can use these functions on relational data when loading it into cubes and cube dimensions, and with the OLAP functions when creating calculated measures.

This chapter describes the row functions of the OLAP expression syntax. It contains these topics:

Row Functions in Alphabetical Order

A B C D E F G H I L M N O P R S T U V W

A


ABS
ACOS
ADD_MONTHS
ASCII
ASCIISTR
ASIN
ATAN
ATAN2

B


BIN_TO_NUM
BITAND

C


CAST
CEIL
CHARTOROWID
CHR
COALESCE
CONCAT
COS
COSH
CURRENT_DATE
CURRENT_TIMESTAMP

D


DBTIMEZONE
DECODE

E


EXP
EXTRACT (datetime)

F


FLOOR
FROM_TZ

G


GREATEST

H


HEXTORAW

I


INITCAP
INSTR

L


LAST_DAY
LEAST
LENGTH
LN
LNNVL
LOCALTIMESTAMP
LOG
LOWER
LPAD
LTRIM

M


MOD
MONTHS_BETWEEN

N


NANVL
NEW_TIME
NEXT_DAY
NLS_CHARSET_ID
NLS_CHARSET_NAME
NLS_INITCAP
NLS_LOWER
NLS_UPPER
NLSSORT
NULLIF
NUMTODSINTERVAL
NUMTOYMINTERVAL
NVL
NVL2

O


ORA_HASH

P


POWER

R


RAWTOHEX
REGEXP_COUNT
REGEXP_INSTR
REGEXP_REPLACE
REGEXP_SUBSTR
REMAINDER
REPLACE
ROUND (date)
ROUND (number)
ROWIDTOCHAR
ROWIDTONCHAR
RPAD
RTRIM

S


SESSIONTIMEZONE
SIGN
SIN
SINH
SOUNDEX
SQRT
SUBSTR
SYS_CONTEXT
SYSDATE
SYSTIMESTAMP

T


TAN
TANH
TO_BINARY_DOUBLE
TO_BINARY_FLOAT
TO_CHAR (character)
TO_CHAR (datetime)
TO_CHAR (number)
TO_DATE
TO_DSINTERVAL
TO_NCHAR (character)
TO_NCHAR (datetime)
TO_NCHAR (number)
TO_NUMBER
TO_TIMESTAMP
TO_TIMESTAMP_TZ
TO_YMINTERVAL
TRANSLATE
TRANSLATE (USING)
TRIM
TRUNC (number)
TZ_OFFSET

U


UID
UNISTR
UPPER
USER

V


VSIZE

W


WIDTH_BUCKET

Row Functions By Category

The row functions are grouped into the following categories:

Numeric Functions

These functions accept numeric input and return numeric values:


ABS
ACOS
ASIN
ATAN
ATAN2
BITAND
CEIL
COS
COSH
EXP
FLOOR
LN
LOG
MOD
NANVL
POWER
REMAINDER
ROUND (number)
SIGN
SIN
SINH
SQRT
TAN
TANH
TRUNC (number)
WIDTH_BUCKET

Character Functions That Return Characters

These functions accept character input and return character values:


CHR
CONCAT
INITCAP
LOWER
LPAD
LTRIM
NLS_CHARSET_NAME
NLS_INITCAP
NLS_LOWER
NLS_UPPER
NLSSORT
REGEXP_REPLACE
REGEXP_SUBSTR
REPLACE
RPAD
RTRIM
SOUNDEX
SUBSTR
TRANSLATE
TRIM
UPPER

NLS Character Functions

These functions return information about a character set:


NLS_CHARSET_ID
NLS_CHARSET_NAME

Character Functions That Return Numbers

These functions accept character input and return numeric values:


ASCII
INSTR
LENGTH
REGEXP_COUNT
REGEXP_INSTR

General Comparison Functions

These functions determine the greatest or least value in a set of values:


GREATEST
LEAST

Encoding and Decoding Function

These functions return a numeric value for each input value:


DECODE
ORA_HASH
VSIZE

Null-Related Functions

These functions facilitate null handling:


COALESCE
LNNVL
NANVL
NULLIF
NVL
NVL2

Environment and Identifier Functions

These functions provide information about the instance and the session:


SYS_CONTEXT
UID
USER
PK܁PX OOPK%AOEBPS/olap_functions023.htm!- SHARE

SHARE

SHARE calculates the ratio of an expression's value for the current dimension member to the value for a related member of the same dimension. Arguments to this function identify which related member is used in the ratio.

Return Value

NUMBER

Syntax

share_expression::=

SHARE (expression share_clause [share_clause]... )
 

share_clause::=

OF { DIMENSION dimension_id | HIERARCHY hierarchy_id }
   { PARENT 
   | TOP 
   | MEMBER 'member_name'
   | DIMENSION LEVEL dim_level_id 
   | HIERARCHY LEVEL hier_level_id 
   }

Arguments

expression

A dimensional expression whose values you want to calculate.

dimension_id

A dimension of expression. The default hierarchy is used in the calculation. If you want to use a different hierarchy, use the HIERARCHY argument instead.

hierarchy_id

A level hierarchy of expression

member_name

A member of the specified dimension or hierarchy.

dim_level_id

The name of a level of dimension_id.

hier_level_id

The name of a level of hierarchy_id.

Share is calculated with these formulas:

KeywordFormula
PARENTcurrent member/parent
TOPcurrent member/root ancestor
MEMBERcurrent member/specified member
DIMENSION LEVELcurrent member/ancestor at specified level or null if the current member is above the specified level.

Example

This example calculates the percent share of the parent member for each product. The results appear in the Share of Parent column.

(SHARE(UNITS_CUBE.SALES OF HIERARCHY PRODUCT.PRIMARY PARENT))*100

The next example calculates the percent share of Total Product for each product. The results appear in the Share of Top column.

(SHARE(UNITS_CUBE.SALES OF HIERARCHY PRODUCT.PRIMARY TOP))*100

ProductParentSalesShare of ParentShare of Top
Desktop PCsHRD745565286054
Portable PCsHRD183382251513
CD/DVDHRD161294971312
MemoryHRD561921954
Modems/FaxHRD557572644
MonitorsHRD397214233
AccessoriesSFT6213535495
Operating SystemsSFT4766857373
DocumentationSFT1814844141
HardwareTOTAL1241913369191
Software/OtherTOTAL1279523699

PKiKV&-!-PK%AOEBPS/row_functions036.htm LOCALTIMESTAMP

LOCALTIMESTAMP

LOCALTIMESTAMP returns the current date and time in the session time zone.

Return Value

TIMESTAMP

Syntax

LOCALTIMESTAMP [ (timestamp_precision) ]

Arguments

timestamp_precision specifies the fractional second precision of the time value returned.

Examples

LOCALTIMESTAMP returns a value such as 09-AUG-06 08.11.37.045186 AM.

LOCALTIMESTAMP(2) returns a value such as 09-AUG-06 08.11.37.040000 AM.

PKa)PK%AOEBPS/row_functions043.htmz NANVL

NANVL

NANVL checks if a value is a number. If it is, then NANVL returns that value. If not, it returns an alternate value. This function is typically used to convert a binary double or binary float NaN (Not a Number) value to zero or null.

Return Value

datatype

Syntax

NANVL (expression, alternate)

Arguments

expression can be any value.

alternate is the numeric value returned if expression is not a number.

PKgGiPK%AOEBPS/row_functions020.htmx CURRENT_TIMESTAMP

CURRENT_TIMESTAMP

CURRENT_TIMESTAMP returns the current date and time in the session time zone. The time zone offset identifies the current local time of the session.

Return Value

TIMESTAMP WITH TIME ZONE

Syntax

CURRENT_TIMESTAMP [ (precision) ]

Arguments

precision specifies the fractional second precision of the returned time value. The default value is 6.

Examples

CURRENT_TIMESTAMP returns a value such as 08-AUG-06 11.18.31.082257 AM -08:00.

CURRENT_TIMESTAMP(2) returns a value such as 08-AUG-06 11.18.31.08 AM -08:00.

PKk|}xPK%AOEBPS/row_functions088.htm" TO_CHAR (number)

TO_CHAR (number)

TO_CHAR(number) converts a numeric expression to a text value in the database character set.

Return Value

VARCHAR2

Syntax

TO_CHAR(n [, fmt [, 'nlsparam' ] ])

Arguments

n is a numeric expression to be converted.

fmt is a text expression that identifies a number format model as described in the Oracle Database SQL Language Reference.

nlsparam specifies the characters that are returned by these number format elements:

This argument has the format shown here:

'NLS_NUMERIC_CHARACTERS = ''dg''
 NLS_CURRENCY = ''text''
 NLS_ISO_CURRENCY = territory '

The characters d and g represent the decimal character and group separator, respectively. They must be different single-byte characters. Within the quoted string, use two single quotation marks around the parameter values. Ten characters are available for the currency symbol.

If you omit this argument or any of the NLS parameters, then this function uses the default values for your session.

Examples

TO_CHAR(1234567, 'C9G999G999D99') returns a text string such as USD1,234,567.00.

TO_CHAR(1234567, 'C9G999G999D99', 'NLS_ISO_CURRENCY = SPAIN') returns the text string EUR1,234,567.00.

PKB/' " PK%AOEBPS/row_functions059.htm RAWTOHEX

RAWTOHEX

RAWTOHEX converts raw data to a character value containing its hexadecimal representation.

Return Value

VARCHAR2

Syntax

RAWTOHEX(raw)

Arguments

raw can be any scalar data type other than LONG, LONG RAW, CLOB, BLOB, or BFILE.

Example

RAWTOHEX(NLSSORT('Rumpelstiltskin')) converts the raw value returned by NLSSORT to the hexadecimal value 52756D70656C7374696C74736B696E00.

PK<PK%AOEBPS/row_functions009.htmV BIN_TO_NUM

BIN_TO_NUM

BIN_TO_NUM converts a bit vector to its equivalent number.

Return Value

NUMBER

Syntax

BIN_TO_NUM(expr [, expr ]... ) 

Arguments

expr is a numeric expression with a value of 0 or 1 for the value of a bit in the bit vector.

Example

BIN_TO_NUM(1,0,1,0) returns the value 10.

PKnP[VPK%AOEBPS/row_functions074.htmJ SIN

SIN

SIN returns the sine of an angle.

Return Value

NUMBER

Syntax

SIN(n)

Arguments

n is a numeric expression for an angle in radians.

Example

SIN(30 * 3.1415927/180) calculates the sine of a 30 degrees angle as the value 0.500000007. The numeric expression converts degrees to radians.

PK;(MOJPK%AOEBPS/preface.htm$= Preface

Preface

The OLAP expression syntax includes analytic functions, arithmetic operators, and single-row functions. The OLAP syntax is an extension of the SQL syntax. If you have used SQL analytic functions or single-row functions, then this syntax is familiar to you.

This preface contains these topics:

Audience

This document is intended for anyone who wants to create calculated measures or transform the data stored in relational tables for use in dimensional database objects such as cubes, cube dimensions, and measures.

Documentation Accessibility

For information about Oracle's commitment to accessibility, visit the Oracle Accessibility Program website at http://www.oracle.com/pls/topic/lookup?ctx=acc&id=docacc.

Access to Oracle Support

Oracle customers have access to electronic support through My Oracle Support. For information, visit http://www.oracle.com/pls/topic/lookup?ctx=acc&id=info or visit http://www.oracle.com/pls/topic/lookup?ctx=acc&id=trs if you are hearing impaired.

Related Documents

For more information, see these documents in the Oracle Database 11.2 documentation set:

Conventions

These text conventions are used in this document:

ConventionMeaning
boldfaceBoldface type indicates graphical user interface elements associated with an action, or terms defined in text or the glossary.
italicItalic type indicates book titles, emphasis, or placeholder variables for which you supply particular values.
monospaceMonospace type indicates commands within a paragraph, URLs, code in examples, text that appears on the screen, or text that you enter.

Backus-Naur Form Syntax

The syntax in this reference is presented in a simple variation of Backus-Naur Form (BNF) that uses the following symbols and conventions:

Symbol or ConventionDescription
[ ]Brackets enclose optional items.
{ }Braces enclose a choice of items, only one of which is required.
|
A vertical bar separates alternatives within brackets or braces.
...Ellipses indicate that the preceding syntactic element can be repeated.
delimitersDelimiters other than brackets, braces, and vertical bars must be entered as shown.
boldfaceWords appearing in boldface are keywords. They must be typed as shown. (Keywords are case-sensitive in some, but not all, operating systems.) Words that are not in boldface are placeholders for which you must substitute a name or value.

PK3t$$PK%AOEBPS/row_functions014.htm CHR

CHR

CHR converts an integer to the character with its binary equivalent in either the database character set or the national character set.

For single-byte character sets, if n > 256, then CHR converts the binary equivalent of mod(n, 256).

For the Unicode national character sets and all multibyte character sets, n must resolve to one entire code point. Code points are not validated, and the result of specifying invalid code points is indeterminate.

Return Value

VARCHAR2 | NVARCHAR2

Syntax

CHR(n [ USING NCHAR_CS ]) 

Arguments

n is a numeric expression.

USING NCHAR_CS returns a character in the national character set. Otherwise, the return value is in the database character set. The OLAP engine uses the UTF8 national character set, so the return value may be different from the SQL CHR function, which uses the database UTF16 national character set.

Example

CHR(67), CHR(67 USING NCHAR_CS), and CHR(323) all return the letter C on an ASCII-based system with the WE8DEC database character set and the UTF8 national character set. CHR(323) is evaluated as CHR(MOD(323, 256)).

PK <  PK%AOEBPS/row_functions003.htmc ADD_MONTHS

ADD_MONTHS

ADD_MONTHS returns a date that is a specified number of months after a specified date.

When the starting date is the last day of the month or when the returned month has fewer days, then ADD_MONTHS returns the last day of the month. Otherwise, the returned day is the starting day.

Return Value

DATE

Syntax

ADD_MONTHS(date, integer) 

Arguments

date is the starting date.

integer is the number of months to be added to the starting date.

Example

ADD_MONTHS('17-JUN-06', 1) returns the value 17-JUL-06.

PKˏkhhcPK%AOEBPS/olap_functions022.htm)6 ROW_NUMBER

ROW_NUMBER

ROW_NUMBER orders the members of a dimension based on the values of an expression. The function returns the sequence numbers of the dimension members.

ROW_NUMBER assigns a unique rank to each dimension member; for identical values, the rank is arbitrary. For example, ROW_NUMBER always returns 1, 2, 3, 4, 5 for a series of five dimension members, even when they have the same value.

Return Value

NUMBER

Syntax

ROW_NUMBER ( ) OVER (rank_clause)

rank_clause::=

{ DIMENSION dimension_id | HIERARCHY hierarchy_id }
  ORDER BY order_by_clause [, order_by_clause]...
  [ WITHIN { PARENT 
            | LEVEL 
            | ANCESTOR AT { DIMENSION LEVEL dim_lvl_id
                           | HIERARCHY LEVEL hier_level_id
                           }
            }
  ]

order_by_clause::=

expression [ASC | DESC] [NULLS {FIRST | LAST}] 

Arguments

dimension_id

The dimension over which the values are calculated using the default hierarchy.

hierarchy_id

The hierarchy over which the values are calculated. If dimension_id is used instead, the default hierarchy is used.

ORDER BY

Provides the basis for the ranking. You can provide additional ORDER BY clauses to break any ties in the order.

expression

Provides the values to use as the basis for the rankings.

ASC | DESC

Sorts the ranking from smallest to largest (ascending) or from largest to smallest (descending).

NULLS {FIRST | LAST}

Determines whether members with null values are listed first or last.

WITHIN

Selects a set of related dimension members to be ranked.

PARENT ranks members at the same level with the same parent.

LEVEL ranks all members at the same level.

ANCESTOR ranks all members at the same level and with the same ancestor at a specified level.

dim_level_id

The name of a level of dimension_id.

hier_level_id

The name of a level of hierarchy_id.

Example

This example ranks time periods within a calendar year by Unit Cost. Notice even though two months (JAN-02 and JUL-02) have the same value, they are assigned sequential numbers (6 and 7).

ROW_NUMBER() OVER (HIERARCHY TIME.CALENDAR ORDER BY PRICE_CUBE.UNIT_COST DESC NULLS LAST WITHIN ANCESTOR AT DIMENSION LEVEL TIME.CALENDAR_YEAR)

ProductTimeCostRow Number
Deluxe MouseMAR-0224.051
Deluxe MouseAPR-0223.952
Deluxe MouseFEB-0223.943
Deluxe MouseAUG-0223.884
Deluxe MouseMAY-0223.845
Deluxe MouseJAN-0223.736
Deluxe MouseJUL-0223.737
Deluxe MouseJUN-0223.728
Deluxe MouseSEP-0223.719
Deluxe MouseNOV-0223.6510
Deluxe MouseDEC-0223.6211
Deluxe MouseOCT-0223.3712

Related Topics

AVERAGE_RANK, DENSE_RANK, RANK

PKn))PK%AOEBPS/row_functions089.htmK TO_DATE

TO_DATE

TO_DATE converts a text expression to a DATE data type.

Return Value

DATE

Syntax

TO_DATE(char [, fmt [, 'nlsparam' ] ])

Arguments

char is a text expression that represents a date.

fmt is a datetime model format specifying the format of char. The default date format is determined implicitly by the NLS_TERRITORY initialization parameter or can be set explicitly by the NLS_DATE_FORMAT parameter. For data type formats, refer to the Oracle Database SQL Language Reference.

nlsparam specifies the language of char. This argument can have this form:

'NLS_DATE_LANGUAGE = language' 

By default, char is in the session date language.

Examples

TO_DATE('October 13, 2008', 'MONTH DD, YYYY') returns the value 13-OCT-08.

TO_DATE('13 Octubre 2008', 'dd month yyyy', 'NLS_DATE_LANGUAGE=SPANISH') also returns the value 13-OCT-08

PKc P K PK%AOEBPS/row_functions055.htm0 NVL

NVL

NVL replaces a null with a string. NVL returns the replacement string when the base expression is null, and the value of the base expression when it is not null.

To replace an expression with one value if it is null and a different value if it is not, use NVL2.

Return Value

Data type of the first argument

Syntax

NVL(expr1, expr2)

Arguments

expr1 is the base expression that is evaluated.

expr2 is the replacement string that is returned when expr1 is null.

Examples

NVL('First String', 'Second String') returns the value First String.

NVL(null, 'Second String') returns the value Second String.

PK%EPK%AOEBPS/olap_functions016.htm^D LEAD_VARIANCE

LEAD_VARIANCE

LEAD_VARIANCE returns the difference between values for the current time period and the offset period.

Return Value

The same data type as the value expression

Syntax

LEAD_VARIANCE (lead_args) OVER (lead_clause)

lead_args::=

expression, offset [, {default_expression | CLOSEST} ]

lead_clause::=

[ {DIMENSION dimension_id | HIERARCHY hierarchy_id} ]
[ [BY] { LEVEL 
       | PARENT 
       | GREGORIAN {YEAR | QUARTER | MONTH | WEEK | DAY}
       | ANCESTOR AT { DIMENSION LEVEL dim_level_id
                      | HIERARCHY LEVEL hier_level_id
                      }
       }
                [POSITION FROM {BEGINNING | END}] 
] 

Arguments

expression

A dimensional expression whose values you want to calculate.

offset

A numeric expression for the number of periods to count forward from the current time period.

default_expression

The value returned when offset does not identify a valid period. This clause is either an expression of any data type or the CLOSEST keyword for the closest match. The closest match is the first member when counting forward.

dimension_id

The Time dimension over which the lead is calculated.

hierarchy_id

The hierarchy over which the lead is calculated. Otherwise, the default hierarchy for dimension_id is used.

dim_level_id

The name of a level of dimension_id.

hier_level_id

The name of a level of hierarchy_id.

BY subclause

The BY subclause identifies the range of time periods used when counting the offset. Following are descriptions of the keywords:

Offset UnitDescription
LEVELThe member at the same level offset periods after the current member. (Default)
PARENTThe member at the same level with the same parent offset periods after the current member.
GREGORIAN YEARThe period at the same level with a start date exactly offset years after the start date of the current period.
GREGORIAN QUARTERThe period at the same level with a start date exactly offset quarters after the start date of the current period.
GREGORIAN MONTHThe period at the same level with a start date exactly offset months after the start date of the current period.
GREGORIAN WEEKThe period at the same level with a start date exactly offset weeks after the start date of the current period.
GREGORIAN DAYThe period at the same level with a start date exactly offset days after the start date of the current period.
ANCESTORThe period at the same level as the current period and whose ancestor is offset positions after the ancestor of the current period.

Examples

This calculation returns the difference between the current value and the value of the next time period based on calendar quarter. The sample output from this calculation appears in the Difference column.

LEAD_VARIANCE (GLOBAL.UNITS_CUBE.UNITS, 1, CLOSEST) OVER (DIMENSION GLOBAL.TIME BY ANCESTOR AT DIMENSION LEVEL GLOBAL.TIME.CALENDAR_QUARTER)

This calculation generates the data in the Percent column.

TimeParentUnitsNext QtrDifference
2005TOTAL565718----
Q1-05CY20051436071380965511
Q2-05CY2005138096138953-857
Q3-05CY2005138953145062-6109
Q4-05CY2005145062146819-1757
Jan-05CY2005.Q150098402239875
Feb-05CY2005.Q14399045477-1487
Mar-05CY2005.Q14951952396-2877
Apr-05CY2005.Q24022345595-5372
May-05CY2005.Q24547746882-1405
Jun-05CY2005.Q252396464765920
Jul-05CY2005.Q34559547476-1881
Aug-05CY2005.Q34688247496-614
Sep-05CY2005.Q34647650090-3614
Oct-05CY2005.Q44747647776-300
Nov-05CY2005.Q44749647695-199
Dec-05CY2005.Q45009051348-1258

Related Topics

LAG, LEAD, LEAD_VARIANCE_PERCENT

PKcD^DPK%AOEBPS/row_functions087.htm k TO_CHAR (datetime)

TO_CHAR (datetime)

TO_CHAR(datetime) converts a datetime or interval expression to a text string in a specified format.

Return Value

VARCHAR2

Syntax

TO_CHAR({ datetime | interval } [, fmt [, 'nlsparam' ] ])

Arguments

datetime is a datetime expression to be converted to text.

interval is an interval expression to be converted to text.

fmt is a datetime model format specifying the format of char. The default date format is determined implicitly by the NLS_TERRITORY initialization parameter or can be set explicitly by the NLS_DATE_FORMAT parameter. For data type formats, refer to the Oracle Database SQL Language Reference.

nlsparam specifies the language in which month and day names and abbreviations are returned. This argument can have this form:

'NLS_DATE_LANGUAGE = language' 

By default, the return value is in the session date language.

Examples

TO_CHAR(SYSDATE) returns a value such as 11-APR-08.

TO_CHAR(SYSDATE, 'Day: MONTH DD, YYYY') returns a value such as Friday : APRIL 11, 2008.

TO_CHAR(SYSDATE, 'Day: MONTH DD, YYYY', 'NLS_DATE_LANGUAGE = Spanish') returns a value such as Viernes : ABRIL 11, 2008.

PK]넙 PK%AOEBPS/row_functions072.htm( SESSIONTIMEZONE

SESSIONTIMEZONE

SESSIONTIMEZONE returns the time zone of the current session. The return type is a time zone offset from Coordinated Universal Time (UTC) or a time zone region name.

Return Value

VARCHAR2

Syntax

SESSIONTIMEZONE

Example

SESSIONTIMEZONE returns the value -05:00 for Eastern Standard Time.

PK.v-(PK%AOEBPS/row_functions067.htmJ ROUND (number)

ROUND (number)

ROUND returns a number rounded to a specified number of places.

Return Value

NUMBER

Syntax

ROUND(n [, integer ])

Arguments

n is the number to round.

integer is the number of decimal places of the rounded number. A negative value rounds to the left of the decimal point. The default value is 0.

Examples

ROUND(15.193) returns the value 15.

ROUND(15.193,1) returns the value 15.2.

ROUND(15.193,-1) returns the value 20.

PKǕTOJPK%AOEBPS/row_functions002.htm ACOS

ACOS

ACOS calculates the angle value in radians of a specified cosine.

Return Value

NUMBER

Syntax

ACOS(n) 

Arguments

n is a numeric expression for the cosine in the range of -1 to 1.

Example

ACOS(.3) returns the value 1.26610367.

PK5ۧPK%AOEBPS/row_functions023.htmW EXP

EXP

EXP returns e raised to the nth power, where e = 2.71828183. The function returns a value of the same type as the argument.

Return Value

NUMBER

Syntax

EXP(n)

Arguments

n is a numeric expression for the exponent.

Example

EXP(4) returns the value 54.59815.

PKS\WPK%AOEBPS/olap_functions019.htm1 MIN

MIN

MIN returns the smallest of a selection of data values calculated over a Time dimension.

The GREGORIAN relations superimpose the Gregorian calendar on the Time dimension. These relations can be useful for calculations on fiscal and nonstandard hierarchies.

Return Value

NUMBER

Syntax

MIN (value_expr) OVER (window_clause)

window_clause::=

[ { DIMENSION dimension_id | HIERARCHY hierarchy_id } ]
    BETWEEN preceding_boundary | following_boundary 
     [WITHIN { LEVEL
              | PARENT
              | GREGORIAN {YEAR | QUARTER | MONTH | WEEK}
              | ANCESTOR AT { DIMENSION LEVEL dim_level_id
                             | HIERARCHY LEVEL hier_level_id 
                             }
              }
     ]

preceding_boundary::=

{UNBOUNDED PRECEDING | expression PRECEDING} AND 
   { CURRENT MEMBER 
   | expression {PRECEDING | FOLLOWING}
   | UNBOUNDED FOLLOWING
   }

following_boundary::=

{CURRENT MEMBER | expression FOLLOWING} AND
  { expression FOLLOWING 
  | UNBOUNDED FOLLOWING
  }

Arguments

value_expr

A dimensional expression whose values you want to calculate.

dimension_id

The Time dimension over which the values are calculated using the default hierarchy.

hierarchy_id

The hierarchy over which the values are calculated. If dimension_id is used instead, the default hierarchy is used.

dim_level_id

The name of a level of dimension_id.

hier_level_id

The name of a level of hierarchy_id.

boundaries

The preceding_boundary and following_boundary identify a range of time periods within the group identified by the dimension or hierarchy.

UNBOUNDED starts with the first period or ends with the last period of the group.

CURRENT MEMBER starts or ends the calculation at the current time period.

expression

A numeric value identifying a period at a particular distance from the current time period that starts or ends the range.

WITHIN subclause

Identifies the range of time periods used in the calculation. Following are descriptions of the keywords.

RangeDescription
LEVELCalculates all time periods at the same level. (Default)
PARENTCalculates time periods at the same level with the same parent.
GREGORIAN YEARCalculates time periods within the same Gregorian year.
GREGORIAN QUARTERCalculates time periods within the same Gregorian quarter.
GREGORIAN MONTHCalculates time periods within the same Gregorian month.
GREGORIAN WEEKCalculates time periods within the same Gregorian week.
ANCESTORIncludes time periods at the same level and with the same ancestor at a specified level.

Example

This example calculates the minimum value between the current member and all subsequent members in the same calendar year. The selection of the data displays the minimum values for the months in 2006.

MIN(GLOBAL.UNITS_CUBE.UNITS) OVER (DIMENSION GLOBAL.TIME BETWEEN CURRENT MEMBER AND UNBOUNDED FOLLOWING WITHIN ANCESTOR AT DIMENSION LEVEL GLOBAL.TIME.CALENDAR_YEAR)

TimeUnitsMinimum
JAN-064777645419
FEB-064769545419
MAR-065134845419
APR-064700545419
MAY-065280945419
JUN-064541945419
JUL-064838846354
AUG-064883046354
SEP-064635446354
OCT-064741146842
NOV-064684246842
DEC-065505255052

Related Topics

AVG, COUNT, MAX, SUM

PK ل11PK%AOEBPS/row_functions025.htmC FLOOR

FLOOR

FLOOR returns the largest integer equal to or less than a specified number.

Return Value

NUMBER 

Syntax

FLOOR(n)

Arguments

n can be any numeric expression.

Examples

FLOOR(15.7) returns the value 15.

FLOOR(-15.7) returns the value -16.

PKHCPK%AOEBPS/row_functions051.htm  NLSSORT

NLSSORT

NLSSORT returns the string of bytes used to sort a text string. You can use this function to specify sorting and comparison operations based on a linguistic sort sequence rather than on the binary value of a string.

Note: NLSSORT returns a RAW value, which you may pass to another function. To create a measure or a calculated measure for the values returned by NLSSORT, use the RAWTOHEX function.

For more information about linguistic sorting, refer to the Oracle Database Globalization Support Guide.

Return Value

RAW

Syntax

NLSSORT(char [, 'nlsparam' ])

Arguments

char is a text expression.

nlsparam is a linguistic sort sequence in the form NLS_SORT =sort[_ai |_ci], where sort is an NLS language. You can add a suffix to the language to modify the sort: _ai for an accent-insensitive sort, or _ci for a case-insensitive sort.

Example

NLSSORT('Rumpelstiltskin') returns the value 52756D70656C7374696C74736B696E00 for a default linguistic sort, which in this case is American.

PK PK%AOEBPS/row_functions048.htm` NLS_INITCAP

NLS_INITCAP

NLS_INITCAP returns a string in which each word begins with a capital followed by lower-case letters. White space and nonalphanumeric characters delimit the words.

Return Value

VARCHAR2

Syntax

NLS_INITCAP (char [, 'nlsparam' ])

Arguments

char can be any text string.

nlsparam can have the form 'NLS_SORT =sort' where sort is either a linguistic sort sequence or BINARY. The linguistic sort sequence handles special linguistic requirements for case conversions. These requirements can result in a return value of a different length than char. If you omit nlsparam, then this function uses the default sort sequence for your session.

Example

NLS_INITCAP('WALKING&THROUGH*A*winter wonderland') returns the value Walking#Through*A*Winter Wonderland.

NLS_INITCAP('ijsland') returns the value Ijsland, but NLS_INITCAP(NLS_INITCAP('ijsland', 'NLS_SORT = XDutch') returns IJsland.

PK*e ` PK%AOEBPS/row_functions062.htm& REGEXP_REPLACE

REGEXP_REPLACE

REGEXP_REPLACE searches a string for a regular pattern and replaces it with another string. By default, the function returns source_char with every occurrence of the regular expression pattern replaced with replace_string.

Return Value

CHAR | NCHAR | VARCHAR2 | NVARCHAR2

Syntax

REGEXP_REPLACE(source_char, pattern
               [, replace_string
                  [, position
                     [, occurrence
                        [, match_parameter ]
                     ]
                  ]
               ]
              )

Arguments

source_char is the text expression that is searched.

pattern is the text expression to search for. It is usually a text literal and can contain up to 512 bytes. For a list of operators, refer to the Oracle Database SQL Language Reference, Appendix D, "Oracle Regular Expression Support."

replace_string is the text that replaces pattern in source_char.

position is a nonzero integer indicating the character of source_char where the function begins the search. When position is negative, then the function counts and searches backward from the end of string. The default value of position is 1, which means that the function begins searching at the first character of source_char.

occurrence is an integer indicating which occurrence of pattern the function should search for. The value of occurrence must be positive. The default values of occurrence is 1, meaning the function searches for the first occurrence of pattern.

match_parameter is a text literal that lets you change the default matching behavior of the function. You can specify one or more of the following values:

Example

REGEXP_REPLACE('500 Oracle Parkway, Redwood Shores, CA', '( ){2,}', ' ')

eliminates extra spaces and returns the string

500 Oracle Parkway, Redwood Shores, CA

PKOa+&PK%AOEBPS/row_functions064.htm REMAINDER

REMAINDER

REMAINDER returns a rounded remainder when one number is divided by another using this equation:

n2 - (n1 * N)

where N is the integer nearest n2/n1.

Return Value

NUMBER

Syntax

REMAINDER(n2, n1)

Arguments

n1 is a numeric expression for the divisor.

n2 is a numeric expression for the dividend.

Example

REMAINDER(18,7) returns the value -3.

PKǸPK%AOEBPS/olap_functions009.htm3 HIER_ORDER

HIER_ORDER

HIER_ORDER sorts the members of a dimension with children immediately after their parents, and returns a sequential number for each member.

Return Value

NUMBER

Syntax

HIER_ORDER ( 
   [member_expression] [WITHIN]
   {DIMENSION dimension_id | HIERARCHY hierarchy_id} ) 

Arguments

member_expression

Identifies a single dimension member within the hierarchy used for the calculation. If this optional argument is specified, then the result does not vary across dimension members.

dimension_id

The dimension over which the values are calculated using the default hierarchy.

hierarchy_id

The hierarchy over which the values are calculated. If dimension_id is used instead, the default hierarchy is used.

Example

This example orders the values of the Time dimension:

HIER_ORDER(DIMENSION "TIME")

TimeOrder
2006138
Q1.06139
JAN-06140
FEB-06141
MAR-06142
Q2.06143
APR-06144
MAY-06145
JUN-06146
Q3.06147
JUL-06148
AUG-06149
SEP-06150
Q4.06151
OCT-06152
NOV-06153
DEC-06154

The next example returns 78 as the order number of Business World in the Market hierarchy of the Customer dimension.

HIER_ORDER('BUSN WRLD' WITHIN HIERARCHY CUSTOMER.MARKET)

PKjlb83PK%AOEBPS/row_functions037.htmA LOG

LOG

LOG computes the logarithm of an expression.

Return Value

NUMBER

Syntax

LOG(n2, n1)

Arguments

n2 is the base by which to compute the logarithm.

n1 is the value whose logarithm is calculated. It can be any numeric expression that is greater than zero. When the value is equal to or less than zero, LOG returns a null value.

Example

LOG(10,100) returns the value 2.

PKdhlPK%AOEBPS/row_functions057.htm; ORA_HASH

ORA_HASH

ORA_HASH generates hash values for an expression. You can use it to randomly assign a set of values into several buckets for analysis, or to generate a set of random numbers.

Return Value

NUMBER

Syntax

ORA_HASH  (expr [, max_bucket [, seed_value ] ])

Arguments

expr can be any expression that provides the data for generating the hash values.

max_bucket is the maximum bucket number. For example, when max_bucket is set to 5, ORA_HASH returns values of 0 to 5, creating six buckets. Set this value from 0 to 4294967295 or 2^32-1 (default).

seed_value is a value used by ORA_HASH to generate the hash values. Enter a different seed_value for different results. Set this value from 0 (default) to 4294967295 or 2^32-1.

Example

ORA_HASH(PRODUCT_CUBE.PRICES, 5) returns a value in the range of 0 to 5 for each value of the Prices measure, as shown in the Hash 5 column. The rows are also sorted on the Hash 5 column.

ORA_HASH(PRODUCT_CUBE.PRICES, 5, 13) also returns values in the range of 0 to 5, but uses a different seed.

ProductPricesHash 5Seed 13
ENVY STD200539.8304
ENVY EXE255029.3105
1GB USB DRV44645.6512
DLX MOUSE1379.4922
144MB DISK3011.4325
512 USB DRV22139.9922
19 SVGA34837.1630
56KPS MODEM1247832
ENVY EXT KBD4312.2235
17 SVGA22605.5541
EXT CD ROM17990.1440
ENVY ABM205462.2551

PKq?PK%AOEBPS/row_functions099.htmS TRANSLATE (USING)

TRANSLATE (USING)

TRANSLATE converts a text string between the database character set and the national character set.

Note: The TRANSLATE USING function is supported primarily for ANSI compatibility. Oracle recommends that you use the TO_CHAR and TO_NCHAR functions for converting data to the database or national character sets. TO_CHAR and TO_NCHAR can take as arguments a greater variety of data types than TRANSLATE USING, which accepts only character data.

Return Value

VARCHAR2 | NVARCHAR2

Syntax

TRANSLATE (char USING { CHAR_CS | NCHAR_CS } )

Arguments

char is a text expression to be converted to the database character set (USING CHAR_CS) or the national character set (USING NCHAR_CS).

Example

TRANSLATE('north by northwest' USING NCHAR_CS) returns the value north by northwest in the national character set.

PK=JX S PK%AOEBPS/row_functions091.htm TO_NCHAR (character)

TO_NCHAR (character)

TO_NCHAR(character) converts a character string to the national character set.

Return Value

NVARCHAR2

Syntax

TO_NCHAR(exp)

Arguments

exp is a text expression. If it contains characters that are not represented in the national character set, then the conversion results in a loss of data.

Example

TO_NCHAR('David Ortiz') returns the value David Ortiz in the national character set.

PK:9;9PK%AOEBPS/row_functions041.html MOD

MOD

MOD returns the remainder after a number is divided by another, or the number if the divisor is 0 (zero).

Return Value

NUMBER

Syntax

MOD(n2, n1)

Arguments

n2 is a numeric expression for the number to be divided.

n1 is a numeric expression for the divisor.

Example

MOD(13,7) returns the value 6.

PKqlPK%AOEBPS/row_functions034.htm LN

LN

LN returns the natural logarithm of a number greater than 0.

Return Value

NUMBER

Syntax

LN(n)

Arguments

n can be any numeric expression with a value greater than 0.

Example

LN(95) returns the value 4.55387689.

PKVPK%AOEBPS/reserved.htm!j Reserved Words

A Reserved Words

This appendix lists the reserved words for the OLAP expression syntax.

Reserved Words

The following are reserved words for the OLAP Expression Syntax. You should not use them or Oracle Database reserved words as object names. However, if you do, be sure to enclose them in double quotes in the expression syntax.

Refer to the Oracle Database SQL Language Reference for a list of Oracle Database reserved words.


AGGREGATE
AGGREGATES
ALL
ALLOW
ANALYZE
ANCESTOR
AND
ANY
AS
ASC
AT
AVG
BETWEEN
BINARY_DOUBLE
BINARY_FLOAT
BLOB
BRANCH
BUILD
BY
BYTE
CASE
CAST
CHAR
CHILD
CLEAR
CLOB
COMMIT
COMPILE
CONSIDER
COUNT
DATATYPE
DATE
DATE_MEASURE
DAY
DECIMAL
DELETE
DESC
DESCENDANT
DIMENSION
DISALLOW
DIVISION
DML
ELSE
END
ESCAPE
EXECUTE
FIRST
FLOAT
FOR
FROM
HIERARCHIES
HIERARCHY
HOUR
IGNORE
IN
INFINITE
INSERT
INTEGER
INTERVAL
INTO
IS
LAST
LEAF_DESCENDANT
LEAVES
LEVEL
LEVELS
LIKE
LIKEC
LIKE2
LIKE4
LOAD
LOCAL
LOG_SPEC
LONG
MAINTAIN
MAX
MEASURE
MEASURES
MEMBER
MEMBERS
MERGE
MLSLABEL
MIN
MINUTE
MODEL
MONTH
NAN
NCHAR
NCLOB
NO
NONE
NOT
NULL
NULLS
NUMBER
NVARCHAR2
OF
OLAP
OLAP_DML_EXPRESSION
ON
ONLY
OPERATOR
OR
ORDER
OVER
OVERFLOW
PARALLEL
PARENT
PLSQL
PRUNE
RAW
RELATIVE
ROOT_ANCESTOR
ROWID
SCN
SECOND
SELF
SERIAL
SET
SOLVE
SOME
SORT
SPEC
SUM
SYNCH
TEXT_MEASURE
THEN
TIME
TIMESTAMP
TO
UNBRANCH
UPDATE
USING
VALIDATE
VALUES
VARCHAR2
WHEN
WHERE
WITHIN
WITH
YEAR
ZERO
ZONE

Special Symbols

Table A-1 lists symbols that are used in the OLAP expression syntax. To enter them as literal characters, enclose them in quotes the same as any other literal text.

Table A-1 OLAP Expression Syntax Symbols

SymbolDescription

,

Comma

||


Concatenate

/


Divide

=


Equals

>

Greater than

>=

Greater than or equal to

[


Left bracket

(

Left parenthesis

<


Less than

<=


Less than or equal to

-

Minus

!=

Not equal to

<>

Not equal to

^=

Not equal to

+


Plus

]


Right bracket

)

Right parenthesis

*


Star


PK!!PK%AOEBPS/row_functions075.htm SINH

SINH

SINH returns the sine of a hyperbolic angle.

Return Value

NUMBER

Syntax

SINH(n)

Arguments

n is a numeric expression for a hyperbolic angle.

Example

SINH(1) returns the value 1.17520119.

PKs$-PK%AOEBPS/row_functions085.htm( TO_BINARY_FLOAT

TO_BINARY_FLOAT

TO_BINARY_FLOAT converts a text or numeric expression to a single-precision floating-point number.

Return Value

BINARY_FLOAT

Syntax

TO_BINARY_FLOAT (expr [, fmt [, 'nlsparam' ] ])

Arguments

n can be any text or numeric expression.

fmt is a text expression that identifies a number format model as described in the Oracle Database SQL Language Reference.

nlsparam specifies the characters used by these number format elements:

This argument has the format shown here:

'NLS_NUMERIC_CHARACTERS = ''dg''
 NLS_CURRENCY = ''text''
 NLS_ISO_CURRENCY = territory '

The d is the decimal character, and the g is the group separator. They must be different single-byte characters. Within the quoted string, use two single quotation marks around the parameter values. Ten characters are available for the currency symbol.

If you omit this argument or any of the NLS parameters, then this function uses the default values for your session to interpret expr.

Examples

All of these examples return the value 1.235E+003:

TO_BINARY_FLOAT(1234.56)

TO_BINARY_FLOAT('$1,234.56', '$9,999.99')

TO_BINARY_FLOAT('1.234,56', '9G999D99', 'NLS_NUMERIC_CHARACTERS='',.''')
PKRo- ( PK%AOEBPS/row_functions106.htm{ USER

USER

USER returns the name of the session user (the user who logged on).

Return Value

VARCHAR2

Syntax

USER

Example

USER returns a value such as GLOBAL.

PK{PK%AOEBPS/row_functions045.htm+ NEXT_DAY

NEXT_DAY

NEXT_DAY returns the date of the first instance of a particular day of the week that follows the specified date.

Return Value

DATE

Syntax

NEXT_DAY(date, char)

Arguments

date is a datetime expression.

char is a text expression that identifies a day of the week (for example, Monday) in the language of your session.

Example

NEXT_DAY('11-SEP-01', 'Monday') returns the value 17-SEP-01.

PKDPK%AOEBPS/row_functions082.htmI TAN

TAN

TAN returns the tangent of an angle.

Return Value

NUMBER

Syntax

TAN(n)

Arguments

n is a numeric expression for an angle in radians.

Example

TAN(135 * 3.1415927/180) calculates the tangent of a 135 degree angle as the value -0.99999993. The expression converts degrees to radians.

PKNIPK%AOEBPS/row_functions050.htm NLS_UPPER

NLS_UPPER

NLS_UPPER converts all alphabetic characters in a text expression to uppercase. The data type of the return value is the same as the original text.

Return Value

CHAR | NCHAR | VARCHAR2 | NVARCHAR2

Syntax

NLS_UPPER (char [, 'nlsparam' ])

Arguments

char can be any text expression.

nlsparam is a linguistic sort sequence in the form NLS_SORT =sort[_ai |_ci], where sort is an NLS language. You can add a suffix to the language to modify the sort: _ai for an accent-insensitive sort, or _ci for a case-insensitive sort.

Example

NLS_UPPER('This is an emergency') returns the string THIS IS AN EMERGENCY.

PK N@ PK%AOEBPS/olap_functions012.htm,S LAG

LAG

LAG returns the value from an earlier time period.

Return Value

The same data type as the value expression

Syntax

LAG (lag_args) OVER (lag_clause)

lag_args::=

expression, offset [, {default_expression | CLOSEST} ]

lag_clause::=

[ {DIMENSION dimension_id | HIERARCHY hierarchy_id} ]
[ [BY] { LEVEL 
       | PARENT 
       | GREGORIAN {YEAR | QUARTER | MONTH | WEEK | DAY}
       | ANCESTOR AT { DIMENSION LEVEL dim_level_id
                      | HIERARCHY LEVEL hier_level_id
                      }
       }
                [POSITION FROM {BEGINNING | END}] 
] 

Arguments

expression

A dimensional expression whose values you want to calculate.

offset

A numeric expression for the number of periods to count back from the current time period.

default_expression

The value returned when offset does not identify a valid period. This clause is either an expression of any data type or the CLOSEST keyword for the closest match. The closest match is the first member when counting back.

dimension_id

The Time dimension over which the lag is calculated.

hierarchy_id

The hierarchy over which the lag is calculated. Otherwise, the default hierarchy for dimension_id is used.

dim_level_id

The name of a level of dimension_id.

hier_level_id

The name of a level of hierarchy_id.

BY subclause

The BY subclause identifies the range of time periods used when counting the offset. Following are descriptions of the keywords:

Offset UnitDescription
LEVELThe member at the same level offset periods before the current member. (Default)
PARENTThe member at the same level with the same parent offset periods before the current member.
GREGORIAN YEARThe period at the same level with a start date exactly offset years before the start date of the current period.
GREGORIAN QUARTERThe period at the same level with a start date exactly offset quarters before the start date of the current period.
GREGORIAN MONTHThe period at the same level with a start date exactly offset months before the start date of the current period.
GREGORIAN WEEKThe period at the same level with a start date exactly offset weeks before the start date of the current period.
GREGORIAN DAYThe period at the same level with a start date exactly offset days before the start date of the current period.
ANCESTORThe period at the same level as the current period and whose ancestor is offset positions before the ancestor of the current period.

Example

This example returns the value from the prior year for each period.

LAG(UNITS_CUBE.UNITS, 1) OVER (HIERARCHY "TIME".CALENDAR ANCESTOR AT DIMENSION LEVEL "TIME".CALENDAR_YEAR)

TimeUnitsLast Year
Q1.05143607146529
Q2.05138096143070
Q3.05138953148292
Q4.05145062149528
Q1.06146819143607
Q2.06145233138096
Q3.06143572138953
Q4.06149305145062

Related Topics

LAG_VARIANCE, LAG_VARIANCE_PERCENT, LEAD

PKeL,,PK%AOEBPS/row_functions056.htmJ NVL2

NVL2

NVL2 returns one value when the value of a specified expression is not null, or another value when the value of the specified expression is null.

To replace a null value with a string, use NVL.

Return Value

Data type of the first argument

Syntax

NVL2(expr1, expr2, expr3)

Arguments

expr1 is the base expression whose value this function evaluates.

expr2 is an expression whose value is returned when expr1 is not null.

expr3 is an expression whose value is returned when expr1 is null.

Example

NVL2('Which string?', 'First String', 'Second String') returns the value First String.

PKtfoPK%A OEBPS/toc.ncxS Oracle® OLAP Expression Syntax Reference, 11g Release 2 (11.2) Cover Table of Contents Oracle OLAP Expression Syntax Reference, Release 11.2 Preface Basic Elements OLAP Functions AVERAGE_RANK AVG COUNT DENSE_RANK HIER_ANCESTOR HIER_CHILD_COUNT HIER_DEPTH HIER_LEVEL HIER_ORDER HIER_PARENT HIER_TOP LAG LAG_VARIANCE LAG_VARIANCE_PERCENT LEAD LEAD_VARIANCE LEAD_VARIANCE_PERCENT MAX MIN OLAP_DML_EXPRESSION RANK ROW_NUMBER SHARE SUM Row Functions ABS ACOS ADD_MONTHS ASCII ASCIISTR ASIN ATAN ATAN2 BIN_TO_NUM BITAND CAST CEIL CHARTOROWID CHR COALESCE CONCAT COS COSH CURRENT_DATE CURRENT_TIMESTAMP DBTIMEZONE DECODE EXP EXTRACT (datetime) FLOOR FROM_TZ GREATEST HEXTORAW INITCAP INSTR LAST_DAY LEAST LENGTH LN LNNVL LOCALTIMESTAMP LOG LOWER LPAD LTRIM MOD MONTHS_BETWEEN NANVL NEW_TIME NEXT_DAY NLS_CHARSET_ID NLS_CHARSET_NAME NLS_INITCAP NLS_LOWER NLS_UPPER NLSSORT NULLIF NUMTODSINTERVAL NUMTOYMINTERVAL NVL NVL2 ORA_HASH POWER RAWTOHEX REGEXP_COUNT REGEXP_INSTR REGEXP_REPLACE REGEXP_SUBSTR REMAINDER REPLACE ROUND (date) ROUND (number) ROWIDTOCHAR ROWIDTONCHAR RPAD RTRIM SESSIONTIMEZONE SIGN SIN SINH SOUNDEX SQRT SUBSTR SYS_CONTEXT SYSDATE SYSTIMESTAMP TAN TANH TO_BINARY_DOUBLE TO_BINARY_FLOAT TO_CHAR (character) TO_CHAR (datetime) TO_CHAR (number) TO_DATE TO_DSINTERVAL TO_NCHAR (character) TO_NCHAR (datetime) TO_NCHAR (number) TO_NUMBER TO_TIMESTAMP TO_TIMESTAMP_TZ TO_YMINTERVAL TRANSLATE TRANSLATE (USING) TRIM TRUNC (number) TZ_OFFSET UID UNISTR UPPER USER VSIZE WIDTH_BUCKET Reserved Words Copyright PKu_8!SSPK%AOEBPS/olap_functions014.htmq3 LAG_VARIANCE_PERCENT

LAG_VARIANCE_PERCENT

LAG_VARIANCE_PERCENT returns the percent difference between values for the current time period and an earlier period.

Return Value

The same data type as the value expression

Syntax

LAG_VARIANCE_PERCENT (lag_args) OVER (lag_clause)

lag_args::=

expression, offset [, {default_expression | CLOSEST} ]

lag_clause::=

[ {DIMENSION dimension_id | HIERARCHY hierarchy_id} ]
[ [BY] { LEVEL 
       | PARENT 
       | GREGORIAN {YEAR | QUARTER | MONTH | WEEK | DAY}
       | ANCESTOR AT { DIMENSION LEVEL dim_level_id
                      | HIERARCHY LEVEL hier_level_id
                      }
       }
                [POSITION FROM {BEGINNING | END}] 
] 

Arguments

expression

A dimensional expression whose values you want to calculate.

offset

A numeric expression for the number of periods to count back from the current time period.

default_expression

The value returned when offset does not identify a valid period. This clause is either an expression of any data type or the CLOSEST keyword for the closest match. The closest match is the first member when counting back.

dimension_id

The Time dimension over which the lag is calculated.

hierarchy_id

The hierarchy over which the lag is calculated. Otherwise, the default hierarchy for dimension_id is used.

dim_level_id

The name of a level of dimension_id.

hier_level_id

The name of a level of hierarchy_id.

BY subclause

The BY subclause identifies the range of time periods used when counting the offset. Following are descriptions of the keywords:

Offset UnitDescription
LEVELThe member at the same level offset periods before the current member. (Default)
PARENTThe member at the same level with the same parent offset periods before the current member.
GREGORIAN YEARThe period at the same level with a start date exactly offset years before the start date of the current period.
GREGORIAN QUARTERThe period at the same level with a start date exactly offset quarters before the start date of the current period.
GREGORIAN MONTHThe period at the same level with a start date exactly offset months before the start date of the current period.
GREGORIAN WEEKThe period at the same level with a start date exactly offset weeks before the start date of the current period.
GREGORIAN DAYThe period at the same level with a start date exactly offset days before the start date of the current period.
ANCESTORThe period at the same level as the current period and whose ancestor is offset positions before the ancestor of the current period.

Examples

This example returns the percent difference in value between the current period and the equivalent period in the prior year.

LAG_VARIANCE_PERCENT (GLOBAL.UNITS_CUBE.UNITS, 1) OVER (HIERARCHY GLOBAL.TIME.CALENDAR ANCESTOR AT DIMENSION LEVEL GLOBAL.TIME.CALENDAR_YEAR)

TimeUnitsLast YearDifferencePercent
Q1.05143607146529-2922-.02
Q2.05138096143070-4974-.03
Q3.05138953148292-9339-.06
Q4.05145062149528-4466-.03
Q1.061468191436073212.02
Q2.061452331380967137.05
Q3.061435721389534619.03
Q4.061493051450624243.03

Related Topics

LAG, LAG_VARIANCE, LEAD

PK$v3q3PK%AOEBPS/row_functions029.htm' INITCAP

INITCAP

INITCAP returns a specified text expression, with the first letter of each word in uppercase and all other letters in lowercase. Words are delimited by white space or non-alphanumeric characters. The data type of the return value is the same as the original text.

Return Value

CHAR | NCHAR | VARCHAR2 | NVARCHAR2

Syntax

INITCAP(char)

Arguments

char can be any text expression.

Example

INITCAP('top ten tunes') and INITCAP('TOP TEN TUNES') both return the string Top Ten Tunes.

PK8#,'PK%AOEBPS/olap_functions021.htm0) RANK

RANK

RANK orders the members of a dimension based on the values of an expression. The function returns the sequence numbers of the dimension members.

RANK assigns the same rank to identical values. For example, RANK may return 1, 2, 3, 3, 5 for a series of five dimension members.

Return Value

NUMBER

Syntax

RANK ( ) OVER (rank_clause)

rank_clause::=

{ DIMENSION dimension_id | HIERARCHY hierarchy_id }
  ORDER BY order_by_clause [, order_by_clause]...
  [ WITHIN { PARENT 
            | LEVEL 
            | ANCESTOR AT { DIMENSION LEVEL dim_lvl_id
                           | HIERARCHY LEVEL hier_level_id
                           }
            }
  ]

order_by_clause::=

expression [ASC | DESC] [NULLS {FIRST | LAST}] 

Arguments

dimension_id

The dimension over which the values are calculated using the default hierarchy.

hierarchy_id

The hierarchy over which the values are calculated. If dimension_id is used instead, the default hierarchy is used.

ORDER BY

Provides the basis for the ranking. You can provide additional ORDER BY clauses to break any ties in the order.

expression

Provides the values to use as the basis for the rankings.

ASC | DESC

Sorts the ranking from smallest to largest (ascending) or from largest to smallest (descending).

NULLS {FIRST | LAST}

Determines whether members with null values are listed first or last.

WITHIN

Selects a set of related dimension members to be ranked.

PARENT ranks members at the same level with the same parent.

LEVEL ranks all members at the same level.

ANCESTOR ranks all members at the same level and with the same ancestor at a specified level.

dim_level_id

The name of a level of dimension_id.

hier_level_id

The name of a level of hierarchy_id.

Example

This example ranks time periods within a calendar year by Unit Cost. Notice that no month is ranked 7, because two months (JAN-02 and JUL-02) have the same value and the same rank (6).

RANK() OVER (DIMENSION TIME.CALENDAR ORDER BY PRICE_CUBE.UNIT_COST DESC NULLS LAST WITHIN ANCESTOR AT DIMENSION LEVEL TIME.CALENDAR_YEAR)

ProductTimeCostRank
Deluxe MouseMAR-0224.051
Deluxe MouseAPR-0223.952
Deluxe MouseFEB-0223.943
Deluxe MouseAUG-0223.884
Deluxe MouseMAY-0223.845
Deluxe MouseJAN-0223.736
Deluxe MouseJUL-0223.736
Deluxe MouseJUN-0223.728
Deluxe MouseSEP-0223.719
Deluxe MouseNOV-0223.6510
Deluxe MouseDEC-0223.6211
Deluxe MouseOCT-0223.3712

Related Topics

AVERAGE_RANK, DENSE_RANK, ROW_NUMBER

PKtt5)0)PK%AOEBPS/row_functions004.htm9 ASCII

ASCII

ASCII returns the decimal representation of the first character of an expression.

Return Value

NUMBER

Syntax

ASCII(char) 

Arguments

char can be any text expression.

Example

ASCII('Boston') returns the value 66, which is the ASCII equivalent of the letter B.

PK^>>9PK%AOEBPS/row_functions022.htm v DECODE

DECODE

DECODE compares an expression to one or more search strings one by one.

If expr is search, then DECODE returns the corresponding result. If there is no match, then DECODE returns default. If you omit default, then DECODE returns null.

Return Value

Data type of the first result argument

Syntax

DECODE(expr, search, result
          [, search, result ]...
          [, default ]
      )

Arguments

expr is an expression that is compared to one or more search strings.

search is a string that is searched for a match to expr.

result is the return value when expr matches the corresponding search string.

default is the return value when expr does not match any of the search strings. If default is omitted, then DECODE returns null.

The arguments can be any numeric or character type. Two nulls are equivalent. If expr is null, then DECODE returns the result of the first search that is also null.

The maximum number of components, including expr, searches, results, and default, is 255.

Example

DECODE(sysdate, '21-JUN-06', 'Summer Solstice', '21-DEC-06', 'Winter Solstice', 'Have a nice day!')

returns these values:

Summer Solstice on June 21, 2006

Winter Solstice on December 21, 2006

Have a nice day! on all other days

PK Cp PK%AOEBPS/row_functions098.htm g TRANSLATE

TRANSLATE

TRANSLATE enables you to make several single-character, one-to-one substitutions in one operation. This expression returns an expression with all occurrences of each character in one string replaced by its corresponding character in a second string.

Return Value

CHAR | NCHAR | VARCHAR2 | NVARCHAR2

Syntax

TRANSLATE(expr, from_string, to_string)

Arguments

expr is a text expression to be modified.

from_string consists of one or more characters to be replaced in expr.

to_string consists of one or more characters that replace the corresponding characters in from_string. This string can be shorter than from_string, so that a null replaces the extra characters. However, to_string cannot be empty.

Example

TRANSLATE('disk', 'dk', 'Dc') returns the value Disc.

PKO PK%AOEBPS/syntax.htm Basic Elements

1 Basic Elements

This chapter describes the basic building blocks of the OLAP expression syntax. It contains these topics:

Dimensional Object Names

The naming conventions for dimensional objects follow standard Oracle naming rules. All names are case-insensitive.

Syntax

owner.{ cube | dimension | table }.{ measure | column | attribute } 

Table 1-1 Naming Conventions for Dimensional Objects

ConventionQuoted IDUnquoted ID

Initial Character

Any character.

Alphabetic character from the database character set.

Other Characters

All characters, punctuation marks, and spaces are permitted.

Double quotation marks and nulls (\0) are not permitted.

Alphanumeric characters from the database character set and underscore (_) are permitted.

The dollar sign ($) and pound sign (#) are permitted but not recommended.

Double quotation marks and nulls (\0) are not permitted.

Reserved Words

Permitted but not recommended.

Not permitted.


Examples

GLOBAL.UNITS_CUBE.SALES identifies the SALES measure in the Units Cube.

TIME.DIM_KEY and TIME.LEVEL_NAME identify columns in the Time views.

TIME.CALENDAR identifies the CALENDAR hierarchy in the Time dimension.

TIME.CALENDAR.CALENDAR_YEAR identifies the CALENDAR_YEAR level of the CALENDAR hierarchy in the Time dimension.

GLOBAL.UNITS_FACT.MONTH_ID identifies a foreign key column in the UNITS_FACT table.

TIME_DIM.CALENDAR_YEAR_DSC identifies a column in the TIME_DIM table.

Dimensional Data Types

Table 1-2 describes the data types that can be used for cubes and measures.

Table 1-2 Dimensional Data Types

Data TypeDescription

BINARY_DOUBLE

A 64-bit floating number. A BINARY_DOUBLE value requires 9 bytes.

BINARY_FLOAT

A 32-bit floating number. A BINARY_FLOAT value requires 5 bytes.

CHAR (size [BYTE|CHAR])

A fixed length character string with a length of size characters or bytes. The size can range from 1 to 2000.

DATE

A valid date in the range from January 1, 4712 BC to December 31, 9999 CE. It contains the datetime fields YEAR, MONTH, DAY, HOUR, MINUTE, and SECOND. It does not have fractional seconds or a time zone. The default format is determined explicitly by the NLS_DATE_FORMAT parameter and implicitly by the NLS_TERRITORY parameter. A DATE value requires 7 bytes.

DECIMAL (p,s)

A decimal number with precision p and scale s represented as a NUMBER data type.

FLOAT [(p)]

A subtype of NUMBER with precision p. A FLOAT is represented internally as NUMBER. The precision can range from 1 to 126 binary digits. A FLOAT value requires from 1 to 22 bytes.

INTEGER

A whole number represented as a NUMBER data type with a scale of 0.

INTERVAL DAY[(day_precision)] TO SECOND[(second_precision)]

A period of time in days, hours, minutes, and seconds. The day precision is the maximum number of digits in the DAY datetime field. The default is 2. The second precision is the number of digits in the fractional part of the SECOND field. The default value is 6. Both day and second precision can have a value from 0 to 9. An INTERVAL DAY TO SECOND value requires 11 bytes.

INTERVAL YEAR[(precision)] TO MONTH

A period of time in years and months. The precision is the number of digits in the YEAR datetime field, which can have a value of 0 to 9. The default precision is 2 digits. An INTERVAL YEAR TO MONTH value requires 5 bytes.

NCHAR[(size)]

A fixed length character string with a length of size characters. The size can range from 1 character to 2000 bytes. The maximum number of characters depends on the national character set, which can require up to four bytes per character.

NUMBER [(p[,s])]

A decimal number with precision p and scale s. The precision can range from 1 to 38. The scale can range from -84 to 127. A NUMBER value requires from 1 to 22 bytes.

NVARCHAR2(size)

A variable length Unicode character string with a maximum length of size characters. The size can range from 1 character to 4000 bytes. The maximum number of characters depends on the national character set, which can require up to four bytes per character.

TIMESTAMP[(precision)]

A valid date that contains the datetime fields YEAR, MONTH, DAY, HOUR, MINUTE, and SECOND. It does not have a time zone. The precision is the number of digits in the fractional part of the SECOND field, which can have a value of 0 to 9. The default precision is 6 digits. The default format is determined explicitly by the NLS_DATE_FORMAT parameter and implicitly by the NLS_TERRITORY parameter. A TIMESTAMP value requires from 7 to 11 bytes depending on the precision.

TIMESTAMP [(precision)] WITH LOCAL TIME ZONE

A valid date with the same description as TIMESTAMP WITH TIME ZONE with these exceptions:

  • The data is stored in the database with the database time zone.

  • The data is converted to the session time zone when it is retrieved.

  • A TIMESTAMP WITH LOCAL TIME ZONE value requires from 7 to 11 bytes depending on the precision.

TIMESTAMP[(precision)] WITH TIME ZONE

A valid date that contains the datetime fields YEAR, MONTH, DAY, HOUR, MINUTE, SECOND, TIMEZONE_HOUR, and TIMEZONE_MINUTE. The precision is the number of digits in the fractional part of the SECOND field, which can have a value of 0 to 9. The default precision is 6 digits. The default format is determined explicitly by the NLS_DATE_FORMAT parameter and implicitly by the NLS_TERRITORY parameter. A TIMESTAMP WITH TIMEZONE value requires 13 bytes.

VARCHAR2(size [BYTE|CHAR])

A variable length character string with a maximum length of size characters or bytes. The size can range from 1 to 4000.


Operators

An operator manipulates data items and returns a result. Operators manipulate individual data items called operands or arguments. They are represented by special characters or by keywords. Syntactically, an operator appears before an operand, after an operand, or between two operands.

The OLAP Expression Syntax has these types of operators:

For conditional operators, go to "Conditions".

Unary Arithmetic Operators

A unary operator operates on only one operand.

Table 1-3 Unary Operators

OperatorDescription

+


Positive value

-

Negative value


Syntax

operator operand

Example

-5 is a negative number.

Binary Arithmetic Operators

A binary operator operates on two operands.

Table 1-4 Binary Operators

OperatorDescription

+


Add

-

Subtract

*


Multiply

/


Divide


Syntax

operand operator operand

Examples

Here are two simple examples using numeric literals for the operands.

7 * 2 is 14.

(8/2) + 1 is 5.

This example multiplies the values of the Sales measure by a numeric literal to create a calculated measure named Sales Budget.

UNITS_CUBE.SALES * 1.06

Table 1-5 Multiplication Operator Example

ProductLevelSalesSales Budget

Hardware

CLASS

124191336

131642816

Desktop PCs

FAMILY

74556528

79029919

Monitors

FAMILY

3972142

4210470

Memory

FAMILY

5619219

5956372

Modems/Fax

FAMILY

5575726

5910269

CD/DVD

FAMILY

16129497

17097267

Portable PCs

FAMILY

18338225

19438518


The next example creates a calculated measure named Profit by subtracting Cost from Sales.

UNITS_CUBE.SALES - UNITS_CUBE.COST

ProductLevelSalesCostProfit
HardwareCLASS1241913361160582488133088
Desktop PCsFAMILY74556528719373122619215
MonitorsFAMILY39721423546195425947
MemoryFAMILY56192194962527656692
Modems/FaxFAMILY55757265162879412847
CD/DVDFAMILY16129497125108323618664
Portable PCsFAMILY1833822517938502399723

Concatenation Operator

The concatenation operator (||) combines text expressions.

Syntax

operand || operand

Example

'The date today is: ' || sysdate generates a text string such as The date today is: 23-AUG-06.

The next example concatenates the level name and dimension keys of the Product dimension to create an identifier.

PRODUCT.LEVEL_NAME || ' ' || PRODUCT.DIM_KEY

LevelDim KeyIdentifier
CLASSHRDCLASS HRD
FAMILYDTPCFAMILY DTPC
FAMILYMONFAMILY MON
FAMILYMEMFAMILY MEM
FAMILYMODFAMILY MOD
FAMILYDISKFAMILY DISK
FAMILYLTPCFAMILY LTPC

Conditions

A condition specifies a combination of one or more expressions and logical (Boolean) operators. The OLAP Expression Syntax has these types of conditions:

Return Value

NUMBER (0=FALSE, 1=TRUE)

Simple Comparison Conditions

Comparison conditions compare one expression with another.

You can use these comparison operators:

Table 1-6 Simple Comparison Operators

OperatorDescription

>

Greater than

>=

Greater than or equal to

<


Less than

<=


Less than or equal to

=


Equal to

!= ^=<>

Not equal to


Syntax

expr { > | >= | < | <= | = | != | ^= | <> } expr 

Arguments

expr can be any expression.

Examples

5 > 3 is true, 4 != 5 is true, 6 >= 9 is false.

Group Comparison Conditions

A group comparison condition specifies a comparison with any or all members in a list or subquery.

You can use these comparison operators:

Table 1-7 Group Comparison Operators

OperatorDescription

>

Greater than

>=

Greater than or equal to

<


Less than

<=


Less than or equal to

=


Equal to

!= ^= <>

Not equal to

ANY SOME

Returns true if one or more values in the list match, or false if no values match.

ALL

Returns true if all values in the list match, or false if one or more values do not match.


Syntax

expr
     { = | != | ^= | <> | > | < | >= | <= }
     { ANY | SOME | ALL }
     ({ expression_list | subquery })

Examples

5 <= ALL (5, 10, 15) is true, 5 <> ANY (5, 10, 15) is true.

Range Conditions

The BETWEEN operator tests whether a value is in a specific range of values. It returns true if the value being tested is greater than or equal to a low value and less than or equal to a high value.

Syntax

expr [ NOT ] BETWEEN expr AND expr

Example

7 NOT BETWEEN 10 AND 15 is true.

Multiple Conditions

Conjunctions compare a single expression with two conditions.

Table 1-8 Conjunctions

OperatorDescription

AND

Returns true if both component conditions are true. Returns false if either is false.

OR

Returns true if either component condition is true. Returns false if both are false.


Syntax

expr operator condition1 { AND | OR } condition2 

Example

5 < 7 AND 5 > 3 is true; 5 < 3 OR 10 < 15 is true.

Negation Conditions

The NOT operator reverses the meaning of a condition. It returns true if the condition is false. It returns false if the condition is true.

Syntax

NOT {BETWEEN | IN | LIKE | NULL }

Example

5 IS NOT NULL is true; 5 NOT IN (5, 10, 15) is false.

Special Conditions

The IS operator tests for special conditions, such as nulls, infinity and values that are not numbers.

Table 1-9 Special Conditions Operators

OperatorDescription

IS INFINITE

Returns true if the expression is infinite, or false otherwise. For mappings only.

IS NAN

Returns true if the expression is not a number, or false otherwise. For mappings only.

IS NULL

Returns true if the expression is null, or false otherwise.


Syntax

expr IS [ NOT ] NULL

Example

13 IS NOT NULL is true.

Pattern-Matching Conditions

The pattern-matching conditions compare character data.

LIKE Operators

The LIKE operators specify a test involving pattern matching. Whereas the equality operator (=) exactly matches one character value to another, the LIKE operators can match patterns defined by special pattern-matching ("wildcard") characters.

You can choose from these LIKE operators:

Table 1-10 LIKE Pattern-Matching Operators

OperatorDescription

LIKE

Uses characters in the input character set.

LIKEC

Uses Unicode complete characters. It treats a Unicode supplementary character as two characters.

LIKE2

Uses UCS2 code points. It treats a Unicode supplementary character as one character.

LIKE4

Uses UCS4 code points. It treats a composite character as one character.


Syntax

char1 [ NOT ] ( LIKE | LIKEC | LIKE2 | LIKE4 )
  char2 [ ESCAPE esc_char ]

Arguments

char1 is a text expression for the search value.

char2 is a text expression for the pattern. The pattern can contain these wildcard characters:

  • An underscore (_) matches exactly one character (as opposed to one byte in a multibyte character set) in the value.

  • A percent sign (%) can match zero or more characters (as opposed to bytes in a multibyte character set) in the value. A '%' cannot match a null.

esc_char is a text expression, usually a literal, that is one character long. This escape character identifies an underscore or a percent sign in the pattern as literal characters instead of wildcard characters. You can also search for the escape character itself by repeating it. For example, if @ is the escape character, then you can use @% to search for % and @@ to search for @.

Examples

'Ducks' LIKE 'Duck_' and 'Ducky' LIKE 'Duck_' are true.

'Duckling' LIKE 'Duck_' is false.

'Duckling' LIKE 'Duck%' is true.

Literal Expressions

The OLAP Expression Syntax has three types of literal expressions: strings, numbers, and null. Other data types must be created using conversion functions such as TO_DATE.

The terms text literal, character literal, and string are used interchangeably. They are always enclosed in single quotes to distinguish them from object names.

Examples

'A Literal Text String'

'A Literal Text String with ''Quotes '''

'A Literal Text String
That Crosses Into a Second Line'

2

2.4

+1

-1

NULL

CASE Expressions

CASE expressions let you use IF... THEN... ELSE logic in expressions.

In a simple case expression, CASE searches for the first WHEN... THEN pair for which expr equals comparison_expr, then it returns return_expr. If none of the WHEN... THEN pairs meet this condition, and an ELSE clause exists, then CASE returns else_expr. Otherwise, CASE returns null.

In a searched CASE expression, CASE searches from left to right until it finds an occurrence of condition that is true, and then returns return_expr. If no condition is found to be true, and an ELSE clause exists, CASE returns else_expr. Otherwise, CASE returns null.

Return Value

Same as the else_expression argument

Syntax

CASE { simple_case_expression
     | searched_case_expression
     }
     [ ELSE else_expression ]
     END

simple_case_expression::=
     expr WHEN comparison_expr
          THEN return_expr
          [ WHEN comparison_expr
            THEN return_expr ]...

searched_case_expression::=
     WHEN condition THEN return_expr
     [ WHEN condition THEN return_expr ]...

Arguments

expr is the base expression being tested.

comparison_expr is the expression against which expr is being tested. It must be the same basic data type (numeric or text) as expr.

condition is a conditional expression.

return_expr is the value returned when a match is found or the condition is true.

Examples

This statement returns Single Item or Value Pack depending on whether the PACKAGE attribute of the PRODUCT dimension is null or has a value:

CASE PRODUCT.PACKAGE WHEN NULL THEN 'Single Item'  ELSE 'Value Pack'END
ProductPackageCategory
1.44MB External 3.5" DisketteExecutiveValue Pack
1GB USB Drive--Single Item
512MB USB Drive--Single Item
56Kbps V.90 Type II ModemExecutiveValue Pack
56Kbps V.92 Type II Fax/ModemLaptop Value PackValue Pack
Deluxe MouseExecutiveValue Pack
Envoy Ambassador--Single Item
Envoy ExecutiveExecutiveValue Pack
Envoy External KeyboardExecutiveValue Pack
Envoy Standard LaptopValue PackValue Pack
External - DVD-RW - 8XExecutiveValue Pack
External 101-key keyboardMultimediaValue Pack
External 48X CD-ROM--Single Item
Internal - DVD-RW - 6XMultimediaValue Pack

The next statement increases the unit price by 20%, truncated to the nearest dollar, if the difference between price and cost is less than 10%. Otherwise, it returns the current unit price.

CASE   
  WHEN PRICE_CUBE.UNIT_PRICE < PRICE_CUBE.UNIT_COST * 1.1 
  THEN TRUNC(PRICE_CUBE.UNIT_COST * 1.2)  ELSE PRICE_CUBE.UNIT_PRICE
END
ProductCostOld Price
1GB USB Drive483.55546.83
512MB USB Drive234.69275.91
56Kbps V.90 Type II Modem135.72158.58
56Kbps V.92 Type II Fax/Modem95.01111.08
Envoy Ambassador2686.012850.88
Envoy Executive2799.802943.96
Envoy Standard1933.821921.62
External - DVD-RW - 8X263.83300.34
External 48X CD-ROM223.11254.15
Internal - DVD-RW - 6X134.46160.18
Internal 48X CD-ROM108.32127.54
Internal 48X CD-ROM USB46.0068.54
Monitor- 17"Super VGA228.53269.70
Monitor- 19"Super VGA445.04504.84
Sentinel Financial1685.721764.14
Sentinel Multimedia1849.171932.54
Sentinel Standard1572.981610.53

The next example creates a Sales Budget calculated measure by multiplying Sales from the previous year by 1.06 for a 6% increase. The detail levels of all dimensions are excluded from the calculation. The Budget is projected only using data from 2006 or later.

CASE 
   WHEN TIME.END_DATE >= TO_DATE('01-JAN-2006') 
      AND TIME.LEVEL_NAME IN ('CALENDAR_YEAR', 'CALENDAR_QUARTER') 
      AND PRODUCT.LEVEL_NAME != 'ITEM' 
      AND CUSTOMER.LEVEL_NAME IN ('TOTAL', 'REGION', 'WAREHOUSE')
   THEN TRUNC(LAG(UNITS_CUBE.SALES, 1) OVER HIERARCHY 
      (TIME.CALENDAR BY ANCESTOR AT LEVEL TIME.CALENDAR.CALENDAR_YEAR 
      POSITION FROM BEGINNING) * 1.06)
   ELSE NULL
END 
ProductTimeSales
HardwareQ1.0528172590
HardwareQ2.0534520379
HardwareQ3.0529466573
HardwareQ4.0532031795
HardwareQ1.0632711891
HardwareQ2.0633637473
HardwareQ3.0629227635
HardwareQ4.0631319881
HardwareQ1.07--
HardwareQ2.07--
HardwareQ3.07--
HardwareQ4.07--

Qualified Data References (QDRs)

Qualified data references (QDRs) limit a dimensional object to a single member in one or more dimensions for the duration of a query.

Syntax

expression [ qualifier [ , qualifier]... ]

qualifier::=

dimension_id = member_expression

Note: The outside square brackets shown in bold are part of the syntax. In this case, they do not indicate an optional argument.

Arguments

expression is a dimensional expression, typically the name of a measure.

dimension_id is a cube dimension of expression.

member_expression resolves to a single member of dimension_id.

Examples

global.sales[global.time = 'CY2007'] returns Sales values for the year 2007.

sales[customer = 'US', time = 'CY2007'] returns Sales values only for the United States in calendar year 2007.

PKGfLPK%AOEBPS/row_functions026.htmr FROM_TZ

FROM_TZ

FROM_TZ converts a timestamp value and a time zone to a TIMESTAMP WITH TIME ZONE data type.

Return Value

TIMESTAMP WITH TIME ZONE

Syntax

FROM_TZ (timestamp_value, time_zone_value)

Arguments

timestamp_value is an expression with a TIMESTAMP data type.

time_zone_value is a text expression that returns a string in the format TZH:TZM or in TZR with optional TZD format.

Example

FROM_TZ(TIMESTAMP '2008-03-26 08:00:00', '3:00') returns the value 26-MAR-08 08.00.00.000000 AM +03:00.

PK5xwrPK%AOEBPS/row_functions095.htm ! TO_TIMESTAMP

TO_TIMESTAMP

TO_TIMESTAMP converts a text expression to a value of TIMESTAMP.

Return Value

TIMESTAMP

Syntax

TO_TIMESTAMP(char [, fmt [ 'nlsparam' ] ])

Arguments

char is a text expression to be converted.

fmt is a datetime model format specifying the format of char. The default date format is determined implicitly by the NLS_TERRITORY initialization parameter or can be set explicitly by the NLS_DATE_FORMAT parameter. For data type formats, refer to the Oracle Database SQL Language Reference.

nlsparam specifies the language in which month and day names and abbreviations given in char. This argument has this form:

'NLS_DATE_LANGUAGE = language' 

By default, char is in the session date language.

Examples

TO_TIMESTAMP('10-SEP-0614:10:10.123000','DD-MON-RRHH24:MI:SS.FF') returns the value 10-SEP-06 02.10.10.123000 PM.

TO_TIMESTAMP('10-AGOSTO-0714:10:10', 'DD-MON-RRHH24:MI:SS.FF', 'NLS_DATE_LANGUAGE=SPANISH') returns the value 10-AUG-07 02.10.10.000000 PM.

PKs PK%AOEBPS/row_functions086.htm" TO_CHAR (character)

TO_CHAR (character)

TO_CHAR(character) converts a text expression to the database character set.

Return Value

VARCHAR2

Syntax

TO_CHAR(exp)

Arguments

char is a text expression. If it contains characters that are not represented in the database character set, then the conversion results in a loss of data.

Examples

TO_CHAR('¡Una qué sorpresa!') returns the value ?Una qu? sorpresa! Two letters are lost in the conversion (¡and é) because they are not in the database character set.

TO_CHAR('David Ortiz') returns the value David Ortiz in the database character set. No characters are lost in this conversion because all of them are in the database character set.

PKS `\' " PK%AOEBPS/content.opfFi Oracle® OLAP Expression Syntax Reference, 11g Release 2 (11.2) en-US E23381-01 Oracle Corporation Oracle Corporation Oracle® OLAP Expression Syntax Reference, 11g Release 2 (11.2) 2011-06-24T13:35:59Z Describes the Oracle OLAP Expression Syntax used to generate information-rich content from the data stored in dimensional database objects such as cubes and cube dimensions. PKeKiFiPK%AOEBPS/olap_functions003.htm1 COUNT

COUNT

COUNT tallies the number of data values identified by a selection of members in a Time dimension.

The GREGORIAN relations superimpose the Gregorian calendar on the Time dimension. These relations can be useful for calculations on fiscal and nonstandard hierarchies.

Return Value

NUMBER

Syntax

COUNT (value_expr) OVER (window_clause)

window_clause::=

{ DIMENSION dimension_id | HIERARCHY hierarchy_id }
  BETWEEN preceding_boundary AND following_boundary 
   [WITHIN { LEVEL
            | PARENT
            | GREGORIAN {YEAR | QUARTER | MONTH | WEEK}
            | ANCESTOR AT { DIMENSION LEVEL dim_level_id
                           | HIERARCHY LEVEL hier_level_id 
                           }
            }
   ]

preceding_boundary::=

{UNBOUNDED PRECEDING | expression PRECEDING} AND 
   { CURRENT MEMBER 
   | expression {PRECEDING | FOLLOWING}
   | UNBOUNDED FOLLOWING
   }

following_boundary::=

{CURRENT MEMBER | expression FOLLOWING} AND
  { expression FOLLOWING 
  | UNBOUNDED FOLLOWING
  }

Arguments

value_expr

A dimensional expression whose values you want to calculate.

dimension_id

The Time dimension over which the values are calculated using the default hierarchy.

hierarchy_id

The hierarchy over which the values are calculated. If dimension_id is used instead, the default hierarchy is used.

dim_level_id

The name of a level of dimension_id.

hier_level_id

The name of a level of hierarchy_id.

boundaries

The preceding_boundary and following_boundary identify a range of time periods within the group identified by the dimension or hierarchy.

UNBOUNDED starts with the first period or ends with the last period of the group.

CURRENT MEMBER starts or ends the calculation at the current time period.

expression

A numeric value identifying a period at a particular distance from the current time period that starts or ends the range.

WITHIN subclause

Identifies the range of time periods used in the calculation. Following are descriptions of the keywords.

RangeDescription
LEVELCalculates all time periods at the same level. (Default)
PARENTCalculates time periods at the same level with the same parent.
GREGORIAN YEARCalculates time periods within the same Gregorian year.
GREGORIAN QUARTERCalculates time periods within the same Gregorian quarter.
GREGORIAN MONTHCalculates time periods within the same Gregorian month.
GREGORIAN WEEKCalculates time periods within the same Gregorian week.
ANCESTORIncludes time periods at the same level and with the same ancestor at a specified level.

Example

This example tallies the number of time periods at the same level and the same year up to and including the current time period. The selected data displays the number of each month in the year.

COUNT(GLOBAL.UNITS_CUBE.UNITS) OVER (HIERARCHY GLOBAL.TIME.CALENDAR BETWEEN UNBOUNDED PRECEDING AND CURRENT MEMBER WITHIN ANCESTOR AT DIMENSION LEVEL GLOBAL.TIME.CALENDAR_YEAR)

TIMEUNITSCOUNT
JAN-06477761
FEB-06476952
MAR-06513483
APR-06470054
MAY-06528095
JUN-06454196
JUL-06483887
AUG-06488308
SEP-06463549
OCT-064741110
NOV-064684211
DEC-065505212

Related Topics

AVG, MAX, MIN, SUM

PK`l11PK%AOEBPS/dcommon/prodbig.gif GIF87a!!!)))111BBBZZZs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?F33?t._Q~Nln:U/Ceb1-im WʸQM+VpafR3d׫é|Aү-q*I P7:y&]hX^Fbtpܩ?|Wu󭏤ʫxJ3ߴm"(uqA}j.+?S wV ~ [B&<^U?rϜ_OH\'.;|.%pw/ZZG'1j(#0UT` Wzw}>_*9m>󑓀F?EL3"zpubzΕ$+0܉&3zڶ+jyr1QE ( ( ( ( ( ( ( (UIdC0EZm+]Y6^![ ԯsmܶ捆?+me+ZE29)B[;я*wGxsK7;5w)}gH~.Ɣx?X\ߚ}A@tQ(:ͧ|Iq(CT?v[sKG+*רqҍck <#Ljα5݈`8cXP6T5i.K!xX*p&ќZǓϘ7 *oƽ:wlຈ:Q5yIEA/2*2jAҐe}k%K$N9R2?7ýKMV!{W9\PA+c4w` Wx=Ze\X{}yXI Ү!aOÎ{]Qx)#D@9E:*NJ}b|Z>_k7:d$z >&Vv󃏽WlR:RqJfGإd9Tm(ҝEtO}1O[xxEYt8,3v bFF )ǙrPNE8=O#V*Cc𹾾&l&cmCh<.P{ʦ&ۣY+Gxs~k5$> ӥPquŽўZt~Tl>Q.g> %k#ú:Kn'&{[yWQGqF}AЅ׮/}<;VYZa$wQg!$;_ $NKS}“_{MY|w7G!"\JtRy+贾d|o/;5jz_6fHwk<ѰJ#]kAȎ J =YNu%dxRwwbEQEQEQEQEQEQEQEQEQE'fLQZ(1F)hQ@X1KEQE-Q@ 1KE3h=iPb(((1GjZ(-ʹRPbR@ 1KE7`bڒyS0(-&)P+ ڎԴP11F)h&:LRmQ@Q@Š(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((9~kmEke z'a::έ:Ș30d`Q^+|hw\}ۆe ʸ{'|Co 2O$ `8PC²訫(S\[5|1- -sn8;@>_[zueI4/8<:׍ua|UKi mh $dC@Ex߳ }{Y#ux.]lUx8=[|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תPEPEPEPEPEPEP\~xGWX uw ݜvuP/^H =&vy]8#g$Cv=]EPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPEPYgW}4ltU8g@5]VC5=N;k;t,G$$I>8꺬sxRm,m{wS6>]OAo>Wu>z^Q6[0D#5 `*Jڟ>mpnݏ/˻V1l@дOiO}+o7n.d82kh-6kF&%W'%Hhu"q?CNX"{ok S@+='CGװW{Nş A`(g'dQWW?O5 `+׎femm;EnH,1yκbO΄4;cϰW} j?w9z> ((((((((((((((((((((((((((( ce?oymqkϊmⷷH8IUQ@ b cŸom/XmݜntuŠ(?\ѬC&+p@5u{=GW$Ne'ew2#E^Eq:~⿰d@7}?mvȟwi럼zWzRmR/:j&nĮpdx'l9xoR5vwiV6R6 =\ߊ~x^ާaUmfٲ&ȰG$uHSO[!\ *_t  Exr%*_}!#U #4 & ֩3|b]L ]t b+Da&R_2lEٱZ`aC)/яmvUkS r(-iPE Vv_{z GLt\2s!F A#葡JY r|AA,hB}q|B`du }00(䡆<pb,G+oB C0p/x$…– ]7 @2HFc ) @AD \0 LHG',(A` `@SC)_" PH`}Y+_|1.K8pAKMA @?3҄$[JPA)+NH I ,@8G0/@R T,`pF8Ѓ)$^$ DDTDlA@ s;PKPK%AOEBPS/dcommon/darbbook.cssPKPK%A!OEBPS/dcommon/O_signature_clr.JPG"(JFIF``C    $.' ",#(7),01444'9=82<.342C  2!!22222222222222222222222222222222222222222222222222" }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr $4%&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ?( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( (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`a (Q 9:&[|ځ,4p Y&BDb,!2@, $wPA'ܠǃ@CO~/d.`I @8ArHx9H75j L 3B/` P#qD*s 3A:3,H70P,R@ p!(F oԥ D;"0 ,6QBRɄHhI@@VDLCk8@NBBL2&pClA?DAk%$`I2 #Q+l7 "=&dL&PRSLIP)PɼirqМ'N8[_}w;PK-PK%AOEBPS/dcommon/booklist.gifGIF89a1޵֥΄kZ{Jk1Rs!BZ)B),@I9Z͓Ca % Dz8Ȁ0FZЌ0P !x8!eL8aWȠFD(~@p+rMS|ӛR$ v "Z:]ZJJEc{*=AP  BiA ']j4$*   & 9q sMiO?jQ = , YFg4.778c&$c%9;PKː5PK%AOEBPS/dcommon/cpyr.htm1 Oracle Legal Notices

Oracle Legal Notices

Copyright Notice

Copyright © 1994-2012, Oracle and/or its affiliates. All rights reserved.

Trademark Notice

Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group.

License Restrictions Warranty/Consequential Damages Disclaimer

This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.

Warranty Disclaimer

The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.

Restricted Rights Notice

If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice is applicable:

U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data delivered to U.S. Government customers are "commercial computer software" or "commercial technical data" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, duplication, disclosure, modification, and adaptation shall be subject to the restrictions and license terms set forth in the applicable Government contract, and, to the extent applicable by the terms of the Government contract, the additional rights set forth in FAR 52.227-19, Commercial Computer Software License (December 2007). Oracle America, Inc., 500 Oracle Parkway, Redwood City, CA 94065.

Hazardous Applications Notice

This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications.

Third-Party Content, Products, and Services Disclaimer

This software or hardware and documentation may provide access to or information on content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services.

Alpha and Beta Draft Documentation Notice

If this document is in prerelease status:

This documentation is in prerelease status and is intended for demonstration and preliminary use only. It may not be specific to the hardware on which you are using the software. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to this documentation and will not be responsible for any loss, costs, or damages incurred due to the use of this documentation.

Oracle Logo

PKN61PK%AOEBPS/dcommon/masterix.gif.GIF89a1ޜΌscJk1Rs!Bc1J),@IS@0"1 Ѿb$b08PbL,acr B@(fDn Jx11+\%1 p { display: none; } /* Class Selectors */ .ProductTitle { font-family: sans-serif; } .BookTitle { font-family: sans-serif; } .VersionNumber { font-family: sans-serif; } .PrintDate { font-family: sans-serif; font-size: small; } .PartNumber { font-family: sans-serif; font-size: small; } PKeӺ1,PK%AOEBPS/dcommon/larrow.gif#GIF87a絵ƌֵƽ{{ss֜ƔZZ{{{{ZZssZZccJJJJRRBBJJJJ991111))!!{,@pH,Ȥrl:ШtpHc`  өb[.64ꑈ53=Z]'yuLG*)g^!8C?-6(29K"Ĩ0Яl;U+K9^u2,@@ (\Ȱ Ë $P`lj 8x I$4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\Y!T\(dǏ!Gdˆ R53ټ R;iʲ)G=@-xn.4Y BuU(*BL0PX v`[D! | >!/;xP` (Jj"M6 ;PK枰pkPK%AOEBPS/dcommon/doccd_epub.jsM /* Copyright 2006, 2012, Oracle and/or its affiliates. All rights reserved. Author: Robert Crews Version: 2012.3.17 */ function addLoadEvent(func) { var oldOnload = window.onload; if (typeof(window.onload) != "function") window.onload = func; else window.onload = function() { oldOnload(); func(); } } function compactLists() { var lists = []; var ul = document.getElementsByTagName("ul"); for (var i = 0; i < ul.length; i++) lists.push(ul[i]); var ol = document.getElementsByTagName("ol"); for (var i = 0; i < ol.length; i++) lists.push(ol[i]); for (var i = 0; i < lists.length; i++) { var collapsible = true, c = []; var li = lists[i].getElementsByTagName("li"); for (var j = 0; j < li.length; j++) { var p = li[j].getElementsByTagName("p"); if (p.length > 1) collapsible = false; for (var k = 0; k < p.length; k++) { if ( getTextContent(p[k]).split(" ").length > 12 ) collapsible = false; c.push(p[k]); } } if (collapsible) { for (var j = 0; j < c.length; j++) { c[j].style.margin = "0"; } } } function getTextContent(e) { if (e.textContent) return e.textContent; if (e.innerText) return e.innerText; } } addLoadEvent(compactLists); function processIndex() { try { if (!/\/index.htm(?:|#.*)$/.test(window.location.href)) return false; } catch(e) {} var shortcut = []; lastPrefix = ""; var dd = document.getElementsByTagName("dd"); for (var i = 0; i < dd.length; i++) { if (dd[i].className != 'l1ix') continue; var prefix = getTextContent(dd[i]).substring(0, 2).toUpperCase(); if (!prefix.match(/^([A-Z0-9]{2})/)) continue; if (prefix == lastPrefix) continue; dd[i].id = prefix; var s = document.createElement("a"); s.href = "#" + prefix; s.appendChild(document.createTextNode(prefix)); shortcut.push(s); lastPrefix = prefix; } var h2 = document.getElementsByTagName("h2"); for (var i = 0; i < h2.length; i++) { var nav = document.createElement("div"); nav.style.position = "relative"; nav.style.top = "-1.5ex"; nav.style.left = "1.5em"; nav.style.width = "90%"; while (shortcut[0] && shortcut[0].toString().charAt(shortcut[0].toString().length - 2) == getTextContent(h2[i])) { nav.appendChild(shortcut.shift()); nav.appendChild(document.createTextNode("\u00A0 ")); } h2[i].parentNode.insertBefore(nav, h2[i].nextSibling); } function getTextContent(e) { if (e.textContent) return e.textContent; if (e.innerText) return e.innerText; } } addLoadEvent(processIndex); PKo"nR M PK%AOEBPS/dcommon/toc.gifGIF89a1ΥΥ{c{Z{JkJk1Rk,@IK% 0| eJB,K-1i']Bt9dz0&pZ1o'q(؟dQ=3S SZC8db f&3v2@VPsuk2Gsiw`"IzE%< C !.hC IQ 3o?39T ҍ;PKv I PK%AOEBPS/dcommon/topnav.gifGIF89a1ֽ筽ޭƔkZZk{Bc{,@ ) l)-'KR$&84 SI) XF P8te NRtHPp;Q%Q@'#rR4P fSQ o0MX[) v + `i9gda/&L9i*1$#"%+ ( E' n7Ȇ(,҅(L@(Q$\x 8=6 'נ9tJ&"[Epljt p#ѣHb :f F`A =l|;&9lDP2ncH R `qtp!dȐYH›+?$4mBA9 i@@ ]@ꃤFxAD*^Ŵ#,(ε  $H}F.xf,BD Z;PK1FAPK%AOEBPS/dcommon/bp_layout.css# @charset "utf-8"; /* bp_layout.css Copyright 2007, Oracle and/or its affiliates. All rights reserved. */ body { margin: 0ex; padding: 0ex; } h1 { display: none; } #FOOTER { border-top: #0d4988 solid 10px; background-color: inherit; color: #e4edf3; clear: both; } #FOOTER p { font-size: 80%; margin-top: 0em; margin-left: 1em; } #FOOTER a { background-color: inherit; color: gray; } #LEFTCOLUMN { float: left; width: 50%; } #RIGHTCOLUMN { float: right; width: 50%; clear: right; /* IE hack */ } #LEFTCOLUMN div.portlet { margin-left: 2ex; margin-right: 1ex; } #RIGHTCOLUMN div.portlet { margin-left: 1ex; margin-right: 2ex; } div.portlet { margin: 2ex 1ex; padding-left: 0.5em; padding-right: 0.5em; border: 1px #bcc solid; background-color: #f6f6ff; color: black; } div.portlet h2 { margin-top: 0.5ex; margin-bottom: 0ex; font-size: 110%; } div.portlet p { margin-top: 0ex; } div.portlet ul { list-style-type: none; padding-left: 0em; margin-left: 0em; /* IE Hack */ } div.portlet li { text-align: right; } div.portlet li cite { font-style: normal; float: left; } div.portlet li a { margin: 0px 0.2ex; padding: 0px 0.2ex; font-size: 95%; } #NAME { margin: 0em; padding: 0em; position: relative; top: 0.6ex; left: 10px; width: 80%; } #PRODUCT { font-size: 180%; } #LIBRARY { color: #0b3d73; background: inherit; font-size: 180%; font-family: serif; } #RELEASE { position: absolute; top: 28px; font-size: 80%; font-weight: bold; } #TOOLS { list-style-type: none; position: absolute; top: 1ex; right: 2em; margin: 0em; padding: 0em; background: inherit; color: black; } #TOOLS a { background: inherit; color: black; } #NAV { float: left; width: 96%; margin: 3ex 0em 0ex 0em; padding: 2ex 0em 0ex 4%; /* Avoiding horizontal scroll bars. */ list-style-type: none; background: transparent url(../gifs/nav_bg.gif) repeat-x bottom; } #NAV li { float: left; margin: 0ex 0.1em 0ex 0em; padding: 0ex 0em 0ex 0em; } #NAV li a { display: block; margin: 0em; padding: 3px 0.7em; border-top: 1px solid gray; border-right: 1px solid gray; border-bottom: none; border-left: 1px solid gray; background-color: #a6b3c8; color: #333; } #SUBNAV { float: right; width: 96%; margin: 0ex 0em 0ex 0em; padding: 0.1ex 4% 0.2ex 0em; /* Avoiding horizontal scroll bars. */ list-style-type: none; background-color: #0d4988; color: #e4edf3; } #SUBNAV li { float: right; } #SUBNAV li a { display: block; margin: 0em; padding: 0ex 0.5em; background-color: inherit; color: #e4edf3; } #SIMPLESEARCH { position: absolute; top: 5ex; right: 1em; } #CONTENT { clear: both; } #NAV a:hover, #PORTAL_1 #OVERVIEW a, #PORTAL_2 #OVERVIEW a, #PORTAL_3 #OVERVIEW a, #PORTAL_4 #ADMINISTRATION a, #PORTAL_5 #DEVELOPMENT a, #PORTAL_6 #DEVELOPMENT a, #PORTAL_7 #DEVELOPMENT a, #PORTAL_11 #INSTALLATION a, #PORTAL_15 #ADMINISTRATION a, #PORTAL_16 #ADMINISTRATION a { background-color: #0d4988; color: #e4edf3; padding-bottom: 4px; border-color: gray; } #SUBNAV a:hover, #PORTAL_2 #SEARCH a, #PORTAL_3 #BOOKS a, #PORTAL_6 #WAREHOUSING a, #PORTAL_7 #UNSTRUCTURED a, #PORTAL_15 #INTEGRATION a, #PORTAL_16 #GRID a { position: relative; top: 2px; background-color: white; color: #0a4e89; } PK3( # PK%AOEBPS/dcommon/bookicon.gif:GIF87a!!!)))111999BBBJJJRRRZZZccckkksss{{{ޭ{{ZRRcZZRJJJBB)!!skRB9{sν{skskcZRJ1)!֭ƽ{ZZRccZJJBBB999111)JJ9BB1ZZB!!ﭵBJJ9BB!!))Jk{)1!)BRZJ{BsR!RRJsJ!J{s!JsBkks{RsB{J{c1RBs1ZB{9BJ9JZ!1BJRRs!9R!!9Z9!1)J19JJRk19R1Z)!1B9R1RB!)J!J1R)J119!9J91!9BkksBBJ119BBR!))9!!!JB1JJ!)19BJRZckތ1)1J9B,H*\hp >"p`ƒFF "a"E|ժOC&xCRz OBtX>XE*O>tdqAJ +,WxP!CYpQ HQzDHP)T njJM2ꔀJ2T0d#+I:<жk 'ꤱF AB @@nh Wz' H|-7f\A#yNR5 /PM09u UjćT|q~Yq@&0YZAPa`EzI /$AD Al!AAal 2H@$ PVAB&c*ؠ p @% p-`@b`uBa l&`3Ap8槖X~ vX$Eh`.JhAepA\"Bl, :Hk;PKx[?:PK%AOEBPS/dcommon/conticon.gif^GIF87a!!!)))111999BBBJJJRRRZZZccckkksss{{{ZRR޽{{ssskkkcccZ991ccRZZBBJJZck)19ZcsBJZ19J!k{k)Z1RZs1!B)!J91{k{)J!B!B911)k{cs!1s!9)s!9!B!k)k1c!)Z!R{9BJcckZZcBBJ99B119{{!!)BBRBBZ!))999R99Z!!999c1!9!)19B1)!B9R,  oua\h2SYPa aowwxYi 9SwyyxxyYSd $'^qYȵYvh ч,/?g{н.J5fe{ڶyY#%/}‚e,Z|pAܠ `KYx,ĉ&@iX9|`p ]lR1khٜ'E 6ÅB0J;t X b RP(*MÄ!2cLhPC <0Ⴁ  $4!B 6lHC%<1e H 4p" L`P!/,m*1F`#D0D^!AO@..(``_؅QWK>_*OY0J@pw'tVh;PKp*c^PK%AOEBPS/dcommon/blafdoc.cssL@charset "utf-8"; /* Copyright 2002, 2011, Oracle and/or its affiliates. All rights reserved. Author: Robert Crews Version: 2011.10.7 */ body { font-family: Tahoma, sans-serif; /* line-height: 125%; */ color: black; background-color: white; font-size: small; } * html body { /* http://www.info.com.ph/~etan/w3pantheon/style/modifiedsbmh.html */ font-size: x-small; /* for IE5.x/win */ f\ont-size: small; /* for other IE versions */ } h1 { font-size: 165%; font-weight: bold; border-bottom: 1px solid #ddd; width: 100%; } h2 { font-size: 152%; font-weight: bold; } h3 { font-size: 139%; font-weight: bold; } h4 { font-size: 126%; font-weight: bold; } h5 { font-size: 113%; font-weight: bold; display: inline; } h6 { font-size: 100%; font-weight: bold; font-style: italic; display: inline; } a:link { color: #039; background: inherit; } a:visited { color: #72007C; background: inherit; } a:hover { text-decoration: underline; } a img, img[usemap] { border-style: none; } code, pre, samp, tt { font-family: monospace; font-size: 110%; } caption { text-align: center; font-weight: bold; width: auto; } dt { font-weight: bold; } table { font-size: small; /* for ICEBrowser */ } td { vertical-align: top; } th { font-weight: bold; text-align: left; vertical-align: bottom; } ol ol { list-style-type: lower-alpha; } ol ol ol { list-style-type: lower-roman; } td p:first-child, td pre:first-child { margin-top: 0px; margin-bottom: 0px; } table.table-border { border-collapse: collapse; border-top: 1px solid #ccc; border-left: 1px solid #ccc; } table.table-border th { padding: 0.5ex 0.25em; color: black; background-color: #f7f7ea; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; } table.table-border td { padding: 0.5ex 0.25em; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; } span.gui-object, span.gui-object-action { font-weight: bold; } span.gui-object-title { } p.horizontal-rule { width: 100%; border: solid #cc9; border-width: 0px 0px 1px 0px; margin-bottom: 4ex; } div.zz-skip-header { display: none; } td.zz-nav-header-cell { text-align: left; font-size: 95%; width: 99%; color: black; background: inherit; font-weight: normal; vertical-align: top; margin-top: 0ex; padding-top: 0ex; } a.zz-nav-header-link { font-size: 95%; } td.zz-nav-button-cell { white-space: nowrap; text-align: center; width: 1%; vertical-align: top; padding-left: 4px; padding-right: 4px; margin-top: 0ex; padding-top: 0ex; } a.zz-nav-button-link { font-size: 90%; } div.zz-nav-footer-menu { width: 100%; text-align: center; margin-top: 2ex; margin-bottom: 4ex; } p.zz-legal-notice, a.zz-legal-notice-link { font-size: 85%; /* display: none; */ /* Uncomment to hide legal notice */ } /*************************************/ /* Begin DARB Formats */ /*************************************/ .bold, .codeinlinebold, .syntaxinlinebold, .term, .glossterm, .seghead, .glossaryterm, .keyword, .msg, .msgexplankw, .msgactionkw, .notep1, .xreftitlebold { font-weight: bold; } .italic, .codeinlineitalic, .syntaxinlineitalic, .variable, .xreftitleitalic { font-style: italic; } .bolditalic, .codeinlineboldital, .syntaxinlineboldital, .titleinfigure, .titleinexample, .titleintable, .titleinequation, .xreftitleboldital { font-weight: bold; font-style: italic; } .itemizedlisttitle, .orderedlisttitle, .segmentedlisttitle, .variablelisttitle { font-weight: bold; } .bridgehead, .titleinrefsubsect3 { font-weight: bold; } .titleinrefsubsect { font-size: 126%; font-weight: bold; } .titleinrefsubsect2 { font-size: 113%; font-weight: bold; } .subhead1 { display: block; font-size: 139%; font-weight: bold; } .subhead2 { display: block; font-weight: bold; } .subhead3 { font-weight: bold; } .underline { text-decoration: underline; } .superscript { vertical-align: super; } .subscript { vertical-align: sub; } .listofeft { border: none; } .betadraft, .alphabetanotice, .revenuerecognitionnotice { color: #e00; background: inherit; } .betadraftsubtitle { text-align: center; font-weight: bold; color: #e00; background: inherit; } .comment { color: #080; background: inherit; font-weight: bold; } .copyrightlogo { text-align: center; font-size: 85%; } .tocsubheader { list-style-type: none; } table.icons td { padding-left: 6px; padding-right: 6px; } .l1ix dd, dd dl.l2ix, dd dl.l3ix { margin-top: 0ex; margin-bottom: 0ex; } div.infoboxnote, div.infoboxnotewarn, div.infoboxnotealso { margin-top: 4ex; margin-right: 10%; margin-left: 10%; margin-bottom: 4ex; padding: 0.25em; border-top: 1pt solid gray; border-bottom: 1pt solid gray; } p.notep1 { margin-top: 0px; margin-bottom: 0px; } .tahiti-highlight-example { background: #ff9; text-decoration: inherit; } .tahiti-highlight-search { background: #9cf; text-decoration: inherit; } .tahiti-sidebar-heading { font-size: 110%; margin-bottom: 0px; padding-bottom: 0px; } /*************************************/ /* End DARB Formats */ /*************************************/ @media all { /* * * { line-height: 120%; } */ dd { margin-bottom: 2ex; } dl:first-child { margin-top: 2ex; } } @media print { body { font-size: 11pt; padding: 0px !important; } a:link, a:visited { color: black; background: inherit; } code, pre, samp, tt { font-size: 10pt; } #nav, #search_this_book, #comment_form, #comment_announcement, #flipNav, .noprint { display: none !important; } body#left-nav-present { overflow: visible !important; } } PKʍPK%AOEBPS/dcommon/rightnav.gif&GIF89a1ֽ筽ޭƔkZZk{Bc{,@ ) l)- $CҠҀ ! D1 #:aS( c4B0 AC8 ְ9!%MLj Z * ctypJBa H t>#Sb(clhUԂ̗4DztSԙ9ZQҀEPEPEPEPEPEPEPM=iԍP Gii c*yF 1׆@\&o!QY00_rlgV;)DGhCq7~..p&1c:u֫{fI>fJL$}BBP?JRWc<^j+χ5b[hֿ- 5_j?POkeQ^hֿ1L^ H ?Qi?z?+_xɔŪ\썽O]χ>)xxV/s)e6MI7*ߊޛv֗2J,;~E4yi3[nI`Ѱe9@zXF*W +]7QJ$$=&`a۾?]N T䏟'X)Ɣkf:j |>NBWzYx0t!* _KkoTZ?K Gc+UyڹgNuh^iSo5{\ܹ3Yos}.>if FqR5\/TӮ#]HS0DKu{($"2xִ{SBJ8=}Y=.|Tsц2UЫ%.InaegKo z ݎ3ֹxxwM&2S%';+I',kW&-"_¿_ Vq^ܫ6pfT2RV A^6RKetto^[{w\jPZ@ޢN4/XN#\42j\(z'j =~-I#:q[Eh|X:sp* bifp$TspZ-}NM*B-bb&*xUr#*$M|QWY ~p~- f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((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((PKje88PK%AOEBPS/dcommon/help.gif!GIF89a1εֵ֜֜{kZsBc{,@ )sƠTQ$8(4ʔ%ŌCK$A HP`$h8ŒSd+ɡ\ H@%' 6M HO3SJM /:Zi[7 \( R9r ERI%  N=aq   qƦs *q-n/Sqj D XZ;PKއ{&!PK%AOEBPS/row_functions028.html HEXTORAW

HEXTORAW

HEXTORAW converts a hexadecimal value to a raw value.

Return Value

RAW

Syntax

HEXTORAW (char)

Arguments

char is a hexadecimal value in the CHAR, VARCHAR2, NCHAR, or NVARCHAR2 data type.

Example

HEXTORAW('7D') returns the RAW value 7D.

PK8qlPK%AOEBPS/row_functions078.htm> SUBSTR

SUBSTR

SUBSTR returns a portion of string, beginning at a specified character position and extending a specified number of characters.

  • SUBSTR calculates lengths using characters as defined by the input character set.

  • SUBSTRB uses bytes instead of characters.

  • SUBSTRC uses Unicode complete characters.

Return Value

CHAR | NCHAR | VARCHAR2 | NVARCHAR2

Syntax

{ SUBSTR | SUBSTRB | SUBSTRC }(char, position [, substring_length ])

Arguments

char is a text expression that provides the base string from which the substring is derived.

position identifies the first character of the substring:

  • When position is positive, then the function counts from the beginning of char to find the first character.

  • When position is negative, then the function counts backward from the end of char.

  • When position is 0 (zero), then the first character is the beginning of the substring.

substring_length is the number of characters in the returned string. By default, the function returns all characters to the end of the base string. If you specify a value less than 1, then the function returns a null.

Examples

SUBSTR('firefly', 1, 4) returns the substring fire.

SUBSTR('firefly', -3, 3) returns the substring fly.

PKxPC > PK%AOEBPS/olap_functions001.htm) AVERAGE_RANK

AVERAGE_RANK

AVERAGE_RANK orders the members of a dimension based on the values of an expression. The function returns the sequence numbers of the dimension members.

AVERAGE_RANK assigns the same average rank to identical values. For example, AVERAGE_RANK may return 1, 2, 3.5, 3.5, 5 for a series of five dimension members.

Return Value

NUMBER

Syntax

AVERAGE_RANK ( ) OVER (rank_clause)

rank_clause::=

{ DIMENSION dimension_id | HIERARCHY hierarchy_id }
  ORDER BY order_by_clause [, order_by_clause]...
  [ WITHIN { LEVEL 
            | PARENT 
            | ANCESTOR AT { DIMENSION LEVEL dim_lvl_id
                           | HIERARCHY LEVEL hier_level_id
                           }
            }
  ]

order_by_clause::=

expression [ASC | DESC] [NULLS {FIRST | LAST}] 

Arguments

dimension_id

The dimension over which the values are calculated using the default hierarchy.

hierarchy_id

The hierarchy over which the values are calculated. If dimension_id is used instead, the default hierarchy is used.

ORDER BY

Provides the basis for the ranking. You can provide additional ORDER BY clauses to break any ties in the order.

expression

Provides the values to use as the basis for the rankings.

ASC | DESC

Sorts the ranking from smallest to largest (ascending) or from largest to smallest (descending).

NULLS {FIRST | LAST}

Determines whether members with null values are listed first or last.

WITHIN

Selects a set of related dimension members to be ranked.

LEVEL ranks all members at the same level.

PARENT ranks members at the same level with the same parent.

ANCESTOR ranks all members at the same level and with the same ancestor at a specified level.

dim_level_id

The name of a level of dimension_id.

hier_level_id

The name of a level of hierarchy_id.

Example

This example ranks time periods within a calendar year by Unit Cost. Notice that no month is ranked 7, because two months (JAN-02 and JUL-02) have the same value and the same rank (6.5).

AVERAGE_RANK() OVER (HIERARCHY TIME.CALENDAR ORDER BY PRICE_CUBE.UNIT_COST DESC NULLS LAST WITHIN ANCESTOR AT DIMENSION LEVEL TIME.CALENDAR_YEAR)

ProductTimeCostAverage Rank
Deluxe MouseMAR-0224.051
Deluxe MouseAPR-0223.952
Deluxe MouseFEB-0223.943
Deluxe MouseAUG-0223.884
Deluxe MouseMAY-0223.845
Deluxe MouseJAN-0223.736.5
Deluxe MouseJUL-0223.736.5
Deluxe MouseJUN-0223.728
Deluxe MouseSEP-0223.719
Deluxe MouseNOV-0223.6510
Deluxe MouseDEC-0223.6211
Deluxe MouseOCT-0223.3712

Related Topics

DENSE_RANK, RANK, ROW_NUMBER

PKu3(#))PK%A OEBPS/toc.htm Table of Contents

Contents

Title and Copyright Information

Preface

1 Basic Elements

2 OLAP Functions

3 Row Functions

A Reserved Words

PKw˜<<PK%AOEBPS/olap_functions024.htm<[ SUM

SUM

SUM returns the total of a selection of values calculated over a Time dimension. You can use the SUM function to create period-to-date calculations.

The GREGORIAN relations superimpose the Gregorian calendar on the Time dimension. These relations can be useful for calculations on fiscal and nonstandard hierarchies.

Return Value

NUMBER

Syntax

SUM (value_expr) OVER (window_clause)

window_clause::=

[ { DIMENSION dimension_id | HIERARCHY hierarchy_id } ]
    BETWEEN preceding_boundary | following_boundary 
      [WITHIN { PARENT
               | LEVEL
               | GREGORIAN {YEAR | QUARTER | MONTH | WEEK}
               | ANCESTOR AT { DIMENSION LEVEL dim_level_id
                              | HIERARCHY LEVEL hier_level_id 
                              }
               }
      ]

preceding_boundary::=

{UNBOUNDED PRECEDING | expression PRECEDING} AND 
   { CURRENT MEMBER 
   | expression {PRECEDING | FOLLOWING}
   | UNBOUNDED FOLLOWING
   }

following_boundary::=

{CURRENT MEMBER | expression FOLLOWING} AND
  { expression FOLLOWING 
  | UNBOUNDED FOLLOWING
  }

Arguments

value_expr

A dimensional expression whose values you want to calculate.

dimension_id

The Time dimension over which the values are calculated using the default hierarchy.

hierarchy_id

The hierarchy over which the values are calculated. If dimension_id is used instead, the default hierarchy is used.

dim_level_id

The name of a level of dimension_id.

hier_level_id

The name of a level of hierarchy_id.

boundaries

The preceding_boundary and following_boundary identify a range of time periods within the group identified by the dimension or hierarchy.

UNBOUNDED starts with the first period or ends with the last period of the group.

CURRENT MEMBER starts or ends the calculation at the current time period.

expression

A numeric value identifying a period at a particular distance from the current time period that starts or ends the range.

WITHIN subclause

Identifies the range of time periods used in the calculation. Following are descriptions of the keywords.

RangeDescription
LEVELCalculates all time periods at the same level. (Default)
PARENTCalculates time periods at the same level with the same parent.
GREGORIAN YEARCalculates time periods within the same Gregorian year.
GREGORIAN QUARTERCalculates time periods within the same Gregorian quarter.
GREGORIAN MONTHCalculates time periods within the same Gregorian month.
GREGORIAN WEEKCalculates time periods within the same Gregorian week.
ANCESTORIncludes time periods at the same level and with the same ancestor at a specified level.

Example

This example calculates the sum of two values, for the current and the following time periods, within a level. The results appear in the Sum column.

SUM(UNITS_CUBE.SALES) OVER (DIMENSION "TIME" BETWEEN 1 PRECEDING AND CURRENT MEMBER WITHIN LEVEL)

TimeSalesSum
Q1.04146529289599
Q2.04143070291362
Q3.04148292297820
Q4.04149528293135
Q1.05143607281703
Q2.05138096277049
Q3.05138953284015
Q4.05145062291881

The next example calculates Year-to-Date Sales.

SUM(UNITS_CUBE.SALES) OVER (HIERARCHY TIME.CALENDAR BETWEEN UNBOUNDED PRECEDING AND CURRENT MEMBER WITHIN ANCESTOR AT DIMENSION LEVEL TIME.CALENDAR_YEAR)

TimeSalesSales YTD
JAN-051209351812093518
FEB-051010316222196680
MAR-05918465831381338
APR-05918596440567302
MAY-051164021652207519
JUN-051681656169024079
JUL-051111090380134982
AUG-05947580789610789
SEP-0512030538101641328
OCT-0511135032112776359
NOV-0511067754123844113

Related Topics

AVG, COUNT, MAX, MIN

PKg<<PK%AOEBPS/row_functions070.htmP RPAD

RPAD

RPAD adds characters to the right of an expression to a specified length. The data type of the return value is the same as the original text.

Use LPAD to add characters to the left.

Return Value

CHAR | NCHAR | VARCHAR2 | NVARCHAR2

Syntax

RPAD(expr1 , n [, expr2 ])

Arguments

expr1 is a text expression for the base string.

n is the total length of the returned expression. If expr1 is longer than n, then this function truncates expr1 to n characters.

expr2 is a text expression for the padding characters. By default, it is a space.

Example

RPAD('Stay tuned', 15, '. ') returns the value Stay tuned. . .

RPAD('Stay tuned', 4) returns the value Stay.

PKxU P PK%AOEBPS/row_functions065.htmb REPLACE

REPLACE

REPLACE searches a string for a regular pattern, replaces it with another string, and returns the modified string.

Return Value

CHAR | NCHAR | VARCHAR2 | NVARCHAR2

Syntax

REPLACE(char, search_string [, replacement_string ])

Arguments

char is the text expression that is searched.

search_string is the text expression to search for.

replacement_string is the text expression that replaces search_string in char.

Example

REPLACE('Nick Nack', 'N', 'Cl') returns the string Click Clack.

PKOgbPK%AOEBPS/row_functions049.htm NLS_LOWER

NLS_LOWER

NLS_LOWER converts all alphabetic characters in a text expression to lowercase. The data type of the return value is the same as the original text.

Return Value

CHAR | NCHAR | VARCHAR2 | NVARCHAR2

Syntax

NLS_LOWER (char [, 'nlsparam' ])

Arguments

char can be any text expression.

nlsparam is a linguistic sort sequence in the form NLS_SORT =sort[_ai |_ci], where sort is an NLS language. You can add a suffix to the language to modify the sort: _ai for an accent-insensitive sort, or _ci for a case-insensitive sort.

Example

NLS_LOWER('STOP SHOUTING') returns the string stop shouting.

PK.PK%AOEBPS/row_functions097.htmq TO_YMINTERVAL

TO_YMINTERVAL

TO_YMINTERVAL converts a text expression to an INTERVAL YEAR TO MONTH data type. The function accepts argument in one of the two formats:

  • SQL interval format compatible with the SQL standard (ISO/IEC 9075:2003)

  • ISO duration format compatible with the ISO 8601:2004 standard

Return Value

INTERVAL YEAR TO MONTH

Syntax

TO_YMINTERVAL  ( ' { sql_format | ym_iso_format } ' )

sql_format::=
[+|-] years - months

ym_iso_format::=
[-] P  [ years Y  ] [months M ] [days D ] [ T  [hours H ] [minutes M ] [seconds [. frac_secs] S  ] ]

Arguments

In SQL format:

years is an integer between 0 and 999999999

months is an integer between 0 and 11.

Additional blanks are allowed between format elements.

In ISO format:

years and months are integers between 0 and 999999999.

days, hours, minutes, seconds, and frac_secs are nonnegative integers and are ignored.

No blanks are allowed in the value.

Examples

TO_YMINTERVAL('1-6') and TO_YMINTERVAL('P1Y6M') return the value +01-06 for 1 year and 6 months.

SYSDATE + TO_YMINTERVAL('1-6') adds one year and six months to the current date. When SYSDATE is 15-APR-08, the value is 15-OCT-09.

SYSDATE + TO_YMINTERVAL('P1Y6M') adds one year and six months to the current date using ISO format. When SYSDATE is 15-APR-08, the value is 15-OCT-09.

SYSDATE + TO_YMINTERVAL('-1-2') subtracts one year and two months from the current date. When SYSDATE is 15-APR-08, the value is 15-FEB-07.

PK&kPK%AOEBPS/row_functions063.htm REGEXP_SUBSTR

REGEXP_SUBSTR

REGEXP_SUBSTR searches a string for a pattern and returns the matching string.

Return Value

CHAR | NCHAR | VARCHAR2 | NVARCHAR

Syntax

REGEXP_SUBSTR(source_char, pattern
              [, position
                 [, occurrence
                    [, match_parameter ]
                 ]
              ]
             )

Arguments

source_char is the text expression that is searched.

pattern is the text expression to search for. It is usually a text literal and can contain up to 512 bytes. For a list of operators, refer to the Oracle Database SQL Language Reference, Appendix D, "Oracle Regular Expression Support."

position is a nonzero integer indicating the character of source_char where the function begins the search. When position is negative, then the function counts and searches backward from the end of string. The default value of position is 1, which means that the function begins searching at the first character of source_char.

occurrence is an integer indicating which occurrence of pattern the function should search for. The value of occurrence must be positive. The default values of occurrence is 1, meaning the function searches for the first occurrence of pattern.

match_parameter is a text expression that lets you change the default matching behavior of the function. You can specify one or more of the following values:

  • c: Case-sensitive matching.

  • i: Case-insensitive matching.

  • m: Treat the source string as multiple lines. The function interprets ^ and $ as the start and end, respectively, of any line anywhere in the source string, rather than only at the start or end of the entire source string. By default, the function treats the source string as a single line.

  • n: New-line character is among the characters matched by a period (the wildcard character). By default, it is not.

  • x: Ignore whitespace characters.

Examples

REGEXP_SUBSTR('7 W 96th St, New York, NEW YORK', 'new york', 10, 2, 'i') starts searching at the tenth character and matches NEW YORK in a case-insensitive match.

REGEXP_SUBSTR('parsley, sage, rosemary, thyme', 's[^,]+e', 1, 2) starts searching at the first character and matches the second substring consisting of the letter s, any number of characters that are not commas, and the letter e. In this example, the function returns the value sage.

PKS PK%AOEBPS/row_functions069.htm ROWIDTONCHAR

ROWIDTONCHAR

ROWIDTONCHAR converts a row address from the ROWID data type to text. The return value is always 18 characters in the national character set.

Return Value

NVARCHAR2

Syntax

ROWIDTONCHAR(rowid)

Arguments

rowid is a row address to convert.

PK"AsPK%AOEBPS/row_functions073.htm7 SIGN

SIGN

SIGN returns a value that indicates whether a specified number is less than, equal to, or greater than 0 (zero):

  • -1 if n < 0

  • 0 if n = 0

  • 1 if n > 0

Return Value

NUMBER

Syntax

SIGN(n)

Arguments

n is a numeric expression.

Example

SIGN(-15) returns the value -1.

PKJPK%AOEBPS/row_functions094.htm TO_NUMBER

TO_NUMBER

TO_NUMBER converts a text expression containing a number to a value of NUMBER data type.

Return Value

NUMBER

Syntax

TO_NUMBER(expr [, fmt [, 'nlsparam' ] ])

Arguments

expr is an expression to be converted to a number.

fmt is a text expression that identifies a number format model as described in the Oracle Database SQL Language Reference.

nlsparam specifies the characters used by these number format elements:

  • Decimal character

  • Group separator

  • Local currency symbol

  • International currency symbol

This argument has the format shown here:

'NLS_NUMERIC_CHARACTERS = ''dg''
 NLS_CURRENCY = ''text''
 NLS_ISO_CURRENCY = territory '

The d is the decimal character, and the g is the group separator. They must be different single-byte characters. Within the quoted string, use two single quotation marks around the parameter values. Ten characters are available for the currency symbol.

If you omit this argument or any of the NLS parameters, then this function uses the default values for your session to interpret expr.

Examples

TO_NUMBER('$1,234,567.89', 'L999G999G999D99') returns the value 1234567.89.

TO_NUMBER('EUR1,234,567.89', 'C999G999G999D99', 'NLS_ISO_CURRENCY=SPAIN') also returns the value 1234567.89.

PK2 !  PK%AOEBPS/olap_functions002.htm/j AVG

AVG

AVG returns the average of a selection of values calculated over a Time dimension. Use this function to create cumulative averages and moving averages.

The GREGORIAN relations superimpose the Gregorian calendar on the Time dimension. These relations can be useful for calculations on fiscal and nonstandard hierarchies.

Return Value

NUMBER

Syntax

AVG (value_expr) OVER (window_clause)

window_clause::=

[ { DIMENSION dimension_id | HIERARCHY hierarchy_id } ]
    BETWEEN preceding_boundary | following_boundary 
     [WITHIN { LEVEL
             | PARENT
             | GREGORIAN {YEAR | QUARTER | MONTH | WEEK}
             | ANCESTOR AT { DIMENSION LEVEL dim_level_id
                           | HIERARCHY LEVEL hier_level_id 
                           }
             }
     ]

preceding_boundary::=

{UNBOUNDED PRECEDING | expression PRECEDING} AND 
   { CURRENT MEMBER 
   | expression {PRECEDING | FOLLOWING}
   | UNBOUNDED FOLLOWING
   }

following_boundary::=

{CURRENT MEMBER | expression FOLLOWING} AND
  { expression FOLLOWING 
  | UNBOUNDED FOLLOWING
  }

Arguments

value_expr

A dimensional expression whose values you want to calculate.

dimension_id

The Time dimension over which the values are calculated using the default hierarchy.

hierarchy_id

The hierarchy over which the values are calculated. If dimension_id is used instead, the default hierarchy is used.

dim_level_id

The name of a level of dimension_id.

hier_level_id

The name of a level of hierarchy_id.

boundaries

The preceding_boundary and following_boundary identify a range of time periods within the group identified by the dimension or hierarchy.

UNBOUNDED starts with the first period or ends with the last period of the group.

CURRENT MEMBER starts or ends the calculation at the current time period.

expression

A numeric value identifying a period at a particular distance from the current time period that starts or ends the range.

WITHIN subclause

Identifies the range of time periods used in the calculation. Following are descriptions of the keywords.

RangeDescription
LEVELCalculates all time periods at the same level. (Default)
PARENTCalculates time periods at the same level with the same parent.
GREGORIAN YEARCalculates time periods within the same Gregorian year.
GREGORIAN QUARTERCalculates time periods within the same Gregorian quarter.
GREGORIAN MONTHCalculates time periods within the same Gregorian month.
GREGORIAN WEEKCalculates time periods within the same Gregorian week.
ANCESTORIncludes time periods at the same level and with the same ancestor at a specified level.

Example

This example calculates a cumulative average within each parent. The selection of data shows the cumulative averages for quarters within the 2005 and 2006 calendar years.

AVG(GLOBAL.UNITS_CUBE.UNITS) OVER (HIERARCHY GLOBAL.TIME.CALENDAR BETWEEN UNBOUNDED PRECEDING AND CURRENT MEMBER WITHIN PARENT)

TIMEPARENTUNITSAVERAGE
Q1.05CY2005143607143607
Q2.05CY2005138096140852
Q3.05CY2005138953140219
Q4.05CY2005145062141430
Q1.06CY2006146819146819
Q2.06CY2006145233146026
Q3.06CY2006143572145208
Q4.06CY2006149305146232

Related Topics

COUNT, MAX, MIN, SUM

PK|//PK%AOEBPS/row_functions008.htmp ATAN2

ATAN2

ATAN2 returns a full-range (0 - 2 pi) numeric value of the arc tangent of a given ratio. The function returns values in the range of -pi to pi, depending on the signs of the arguments.

Use ATAN to calculate the angle value (in radians) of a specified tangent that is not a ratio.

Return Value

NUMBER

Syntax

ATAN2(n1, n2) 

Arguments

n1 and n2 are numeric expressions for the components of the ratio.

Example

ATAN2(.3, .2) returns the value 0.982793723.

PKpupPK%AOEBPS/row_functions068.htm ROWIDTOCHAR

ROWIDTOCHAR

ROWIDTOCHAR converts a row address from a ROWID data type to text.The return value is always 18 characters long in the database character set.

Return Value

VARCHAR2

Syntax

ROWIDTOCHAR(rowid)

Arguments

rowid is a row address to convert.

PKPK%AOEBPS/olap_functions011.htmg HIER_TOP

HIER_TOP

HIER_TOP returns the topmost ancestor of either all members of a hierarchy or a particular member. The hierarchy can be either level-based or value-based.

Return Value

VARCHAR2

Syntax

HIER_TOP ( 
   [member_expression] [WITHIN]
   {DIMENSION dimension_id | HIERARCHY hierarchy_id} ) 

Arguments

member_expression

Identifies a single dimension member within the hierarchy used for the calculation. If this optional argument is specified, then the result does not vary across dimension members.

dimension_id

The dimension over which the values are calculated using the default hierarchy.

hierarchy_id

The hierarchy over which the values are calculated. If dimension_id is used instead, the default hierarchy is used.

Example

This example returns the top member of the default hierarchy of the Time dimension.

HIER_TOP(DIMENSION "TIME")

TimeTop
2006TOTAL
Q1.06TOTAL
Q2.06TOTAL
Q3.06TOTAL
Q4.06TOTAL
JAN-06TOTAL
FEB-06TOTAL
MAR-06TOTAL
APR-06TOTAL
MAY-06TOTAL
JUN-06TOTAL
JUL-06TOTAL
AUG-06TOTAL
SEP-06TOTAL
OCT-06TOTAL
NOV-06TOTAL
DEC-06TOTAL

The next example returns TOTAL, which is the top member for Europe in the default hierarchy of the Customer dimension.

HIER_TOP('EMEA' WITHIN DIMENSION CUSTOMER)

PKH[lgPK%AOEBPS/olap_functions017.htmJ LEAD_VARIANCE_PERCENT

LEAD_VARIANCE_PERCENT

LEAD_VARIANCE_PERCENT returns the percent difference between values for the current time period and the offset period.

Return Value

The same data type as the value expression

Syntax

LEAD_VARIANCE_PERCENT (lead_args) OVER (lead_clause)

lead_args::=

expression, offset [, {default_expression | CLOSEST} ]

lead_clause::=

[ {DIMENSION dimension_id | HIERARCHY hierarchy_id} ]
[ [BY] { LEVEL 
       | PARENT 
       | GREGORIAN {YEAR | QUARTER | MONTH | WEEK | DAY}
       | ANCESTOR AT { DIMENSION LEVEL dim_level_id
                      | HIERARCHY LEVEL hier_level_id
                      }
       }
                [POSITION FROM {BEGINNING | END}] 
] 

Arguments

expression

A dimensional expression whose values you want to calculate.

offset

A numeric expression for the number of periods to count forward from the current time period.

default_expression

The value returned when offset does not identify a valid period. This clause is either an expression of any data type or the CLOSEST keyword for the closest match. The closest match is the first member when counting forward.

dimension_id

The Time dimension over which the lead is calculated.

hierarchy_id

The hierarchy over which the lead is calculated. Otherwise, the default hierarchy for dimension_id is used.

dim_level_id

The name of a level of dimension_id.

hier_level_id

The name of a level of hierarchy_id.

BY subclause

The BY subclause identifies the range of time periods used when counting the offset. Following are descriptions of the keywords:

Offset UnitDescription
LEVELThe member at the same level offset periods after the current member. (Default)
PARENTThe member at the same level with the same parent offset periods after the current member.
GREGORIAN YEARThe period at the same level with a start date exactly offset years after the start date of the current period.
GREGORIAN QUARTERThe period at the same level with a start date exactly offset quarters after the start date of the current period.
GREGORIAN MONTHThe period at the same level with a start date exactly offset months after the start date of the current period.
GREGORIAN WEEKThe period at the same level with a start date exactly offset weeks after the start date of the current period.
GREGORIAN DAYThe period at the same level with a start date exactly offset days after the start date of the current period.
ANCESTORThe period at the same level as the current period and whose ancestor is offset positions after the ancestor of the current period.

Example

This calculation returns the percent difference between the current value and the value of the next time period based on calendar quarter. The sample output from this calculation appears in the Percent column.

LEAD_VARIANCE_PERCENT (GLOBAL.UNITS_CUBE.UNITS, 1, CLOSEST) OVER (DIMENSION GLOBAL.TIME BY ANCESTOR AT DIMENSION LEVEL GLOBAL.TIME.CALENDAR_QUARTER)

TimeParentUnitsNext QtrDifferencePercent
2005TOTAL565718------
Q1-05CY20051436071380965511.04
Q2-05CY2005138096138953-857-.01
Q3-05CY2005138953145062-6109-.04
Q4-05CY2005145062146819-1757-.01
Jan-05CY2005.Q150098402239875.25
Feb-05CY2005.Q14399045477-1487-.03
Mar-05CY2005.Q14951952396-2877-.05
Apr-05CY2005.Q24022345595-5372-.12
May-05CY2005.Q24547746882-1405-.03
Jun-05CY2005.Q252396464765920.13
Jul-05CY2005.Q34559547476-1881-.04
Aug-05CY2005.Q34688247496-614-.01
Sep-05CY2005.Q34647650090-3614-.07
Oct-05CY2005.Q44747647776-300-.01
Nov-05CY2005.Q44749647695-1990
Dec-05CY2005.Q45009051348-1258-.02

Related Topics

LAG, LEAD, LEAD_VARIANCE

PKs JJPK%AOEBPS/row_functions060.htmQ REGEXP_COUNT

REGEXP_COUNT

REGEXP_COUNT searches a string for a regular pattern and returns the number of times the pattern occurs. If no match is found, the function returns 0.

The function evaluates strings using characters as defined by the input character set.

Return Value

NUMBER

Syntax

REGEXP_COUNT (source_char, pattern
              [, position
                 [, match_parameter ]
              ]
             )

Arguments

source_char is the text expression to search.

pattern is the string to search for. A period matches any character. For a list of operators, refer to the Oracle Database SQL Language Reference, Appendix D, "Oracle Regular Expression Support."

position is a nonzero integer indicating the character of source_char where the function begins the search. When position is negative, then the function counts and searches backward from the end of string. The default value of position is 1, which means that the function begins searching at the first character of source_char.

match_parameter is a text literal that lets you change the default matching behavior of the function. You can specify one or more of the following values:

  • c: Case-sensitive matching.

  • i: Case-insensitive matching.

  • m: Treat the source string as multiple lines. The function interprets ^ and $ as the start and end, respectively, of any line anywhere in the source string, rather than only at the start or end of the entire source string. By default, the function treats the source string as a single line.

  • n: New-line character is among the characters matched by a period (the wildcard character). By default, it is not.

  • x: Ignore whitespace characters.

Example

REGEXP_COUNT('Mississippi', 'i', 1) searches the string Mississippi for the letter i, beginning the search at the first letter. It returns the value 4.

PKPK%AOEBPS/row_functions058.htm POWER

POWER

POWER raises a number to a power.

Return Value

NUMBER

Syntax

POWER(n2, n1)

Arguments

n2 is any numeric expression that is raised to a power.

n1 is the exponent.

Example

POWER(3,2) returns the value 9.

PKBPK%AOEBPS/row_functions030.htm 6 INSTR

INSTR

The INSTR functions search string for substring. The function returns an integer indicating the position of the character in string, or a zero (0) if does not find a match.

  • INSTR calculates strings using characters as defined by the input character set.

  • INSTRB uses bytes instead of characters.

  • INSTRC uses Unicode complete characters.

REGEXP_INSTR provides additional options.

Return Value

NUMBER

Syntax

{ INSTR | INSTRB | INSTRC }
(string , substring [, position [, occurrence ] ])

Arguments

string is the text expression to search.

substring is the text string to search for.

position is a nonzero integer indicating the character in string where the function begins the search. When position is negative, then INSTR counts and searches backward from the end of string. The default value of position is 1, which means that the function begins searching at the first character of string.

occurrence is an integer indicating which occurrence of string the function should search for. The value of occurrence must be positive. The default values of occurrence is 1, meaning the function searches for the first occurrence of substring.

Example

INSTR('CORPORATE FLOOR','OR', 3, 2) searches the string CORPORATE FLOOR beginning with the third character (R) for the second instance of the substring OR. It returns the value 14, which is the position of the second O in FLOOR.

PKh PK%AOEBPS/row_functions093.htm+ TO_NCHAR (number)

TO_NCHAR (number)

TO_NCHAR(number) converts a number to the national character set.

Return Value

NVARCHAR2

Syntax

TO_CHAR(n [, fmt [, 'nlsparam' ] ])

Arguments

n is a numeric expression to be converted.

fmt is a text expression that identifies a number format model as described in the Oracle Database SQL Language Reference.

nlsparam is a text expression that specifies the characters that are returned by these number format elements:

  • Decimal character

  • Group separator

  • Local currency symbol

  • International currency symbol

This argument has the format shown here:

'NLS_NUMERIC_CHARACTERS = ''dg''
   NLS_CURRENCY = ''text''
   NLS_ISO_CURRENCY = territory '

The characters d and g represent the decimal character and group separator, respectively. They must be different single-byte characters. Within the quoted string, use two single quotation marks around the parameter values. Ten characters are available for the currency symbol.

If you omit this argument or any of the NLS parameters, then this function uses the default values for your session.

Examples

TO_NCHAR(1234567, 'C9G999G999D99') returns a text string such as USD1,234,567.00.

TO_NCHAR(1234567, 'C9G999G999D99', 'NLS_ISO_CURRENCY = SPAIN') returns the text string EUR1,234,567.00.

PK?0 + PK%AOEBPS/row_functions012.htmD CEIL

CEIL

CEIL returns the smallest whole number greater than or equal to a specified number.

Return Value

NUMBER

Syntax

CEIL(n) 

Arguments

n is a numeric expression.

Examples

CEIL(3.1415927) returns the value 4.

CEIL(-3.4) returns the value -3.00.

PKC IDPK%AOEBPS/olap_functions006.htmU HIER_CHILD_COUNT

HIER_CHILD_COUNT

HIER_CHILD_COUNT returns the number of children of either all dimension members in a hierarchy or a particular member. The hierarchy can be either level-based or value-based.

Return Value

NUMBER

Syntax

HIER_CHILD_COUNT ( 
   [member_expression] [WITHIN]
   {DIMENSION dimension_id | HIERARCHY hierarchy_id} ) 

Arguments

member_expression

Identifies a single dimension member within the hierarchy used for the calculation. If this optional argument is specified, then the result does not vary across dimension members.

dimension_id

The dimension over which the values are calculated using the default hierarchy.

hierarchy_id

The hierarchy over which the values are calculated. If dimension_id is used instead, the default hierarchy is used.

Example

This example returns the number of children for each member of the default hierarchy of the Time dimension.

HIER_CHILD_COUNT(DIMENSION "TIME")

TimeChildren
20064
Q1.063
Q2.063
Q3.063
Q4.063
JAN-060
FEB-060
MAR-060
APR-060
MAY-060
JUN-060
JUL-060
AUG-060
SEP-060
OCT-060
NOV-060
DEC-060

The next example returns 8 as the number of children for Government within the Market hierarchy of the Customer dimension.

HIER_CHILD_COUNT('GOV' WITHIN HIERARCHY CUSTOMER.MARKET)

PK ZUPK%AOEBPS/olap_functions005.htmf HIER_ANCESTOR

HIER_ANCESTOR

HIER_ANCESTOR returns the ancestor at a particular level of a hierarchy for either all members in the hierarchy or a particular member. The hierarchy must be level-based.

Return Value

VARCHAR2

Syntax

HIER_ANCESTOR( 
  [member_expression] [WITHIN]
  {DIMENSION dimension_id | HIERARCHY hierarchy_id}
  {DIMENSION LEVEL dim_level_id | HIERARCHY LEVEL hier_level_id} ) 

Arguments

member_expression

Identifies a dimension member within the hierarchy whose ancestor is returned. If this optional argument is specified, then the result does not vary across dimension members.

dimension_id

The dimension over which the values are calculated using the default hierarchy.

hierarchy_id

The hierarchy over which the values are calculated. If dimension_id is used instead, the default hierarchy is used.

dim_level_id

The level of the ancestor in dimension_id.

hier_level_id

The level of the ancestor in hierarchy_id.

Example

This example returns the ancestor at the Calendar Quarter level for members of the default Calendar hierarchy of the Time dimension.

HIER_ANCESTOR(DIMENSION "TIME" DIMENSION LEVEL TIME.CALENDAR_QUARTER)

TimeAncestor
2006--
Q1.06CY2006.Q1
Q2.06CY2006.Q2
Q3.06CY2006.Q3
Q4.06CY2006.Q4
JAN-06CY2006.Q1
FEB-06CY2006.Q1
MAR-06CY2006.Q1
APR-06CY2006.Q2
MAY-06CY2006.Q2
JUN-06CY2006.Q2
JUL-06CY2006.Q3
AUG-06CY2006.Q3
SEP-06CY2006.Q3
OCT-06CY2006.Q4
NOV-06CY2006.Q4
DEC-06CY2006.Q4

The next example returns GOV as the ancestor of the US Department of Labor at the Customer Market Segment level in the Market hierarchy of the Customer dimension.

HIER_ANCESTOR('US DPT LBR' WITHIN HIERARCHY CUSTOMER.MARKET DIMENSION LEVEL CUSTOMER.MARKET_SEGMENT)

PK#qkfPK%AOEBPS/olap_functions010.htm? HIER_PARENT

HIER_PARENT

HIER_PARENT returns the parent of either all dimension members in a hierarchy or a particular member. The hierarchy can be either level-based or value-based.

Return Value

VARCHAR2

Syntax

HIER_PARENT ( 
   [member_expression] [WITHIN]
   {DIMENSION dimension_id | HIERARCHY hierarchy_id} ) 

Arguments

member_expression

Identifies a single dimension member within the hierarchy used for the calculation. If this optional argument is specified, then the result does not vary across dimension members.

dimension_id

The dimension over which the values are calculated using the default hierarchy.

hierarchy_id

The hierarchy over which the values are calculated. If dimension_id is used instead, the default hierarchy is used.

Example

This example returns the parents of all members of the default hierarchy of the Time dimension.

HIER_PARENT(DIMENSION GLOBAL.TIME)

TimeParent
2006TOTAL
Q1.06CY2006
Q2.06CY2006
Q3.06CY2006
Q4.06CY2006
JAN-06CY2006.Q1
FEB-06CY2006.Q1
MAR-06CY2006.Q1
APR-06CY2006.Q2
MAY-06CY2006.Q2
JUN-06CY2006.Q2
JUL-06CY2006.Q3
AUG-06CY2006.Q3
SEP-06CY2006.Q3
OCT-06CY2006.Q4
NOV-06CY2006.Q4
DEC-06CY2006.Q4

The next example returns EMEA as the parent of Italy within the default hierarchy of the Customer dimension.

HIER_PARENT('ITA' WITHIN DIMENSION CUSTOMER)

PKȷqPK%AOEBPS/row_functions042.htm MONTHS_BETWEEN

MONTHS_BETWEEN

MONTHS_BETWEEN calculates the number of months between two dates. When the two dates have the same day component or are both the last day of the month, then the return value is a whole number. Otherwise, the return value includes a fraction that considers the difference in the days based on a 31-day month.

Return Value

NUMBER

Syntax

MONTHS_BETWEEN(date1, date2)

Arguments

date1 and date2 are datetime expressions. If date1 is later than date2, then the result is positive. If date1 is earlier than date2, then the result is negative.

Example

MONTHS_BETWEEN('15-APR-06', '01-JAN-06') returns the value 3.4516129.

PKVPK%AOEBPS/row_functions107.htm VSIZE

VSIZE

VSIZE returns the number of bytes in the internal representation of an expression. It returns null for a null expression.

Return Value

NUMBER

Syntax

VSIZE (expr)

Arguments

expr can be an expression of any data type.

Example

VSIZE('Sound of thunder') returns the value 16.

VSIZE(CHANNEL.LONG_DESCRIPTION) returns the following values:

ChannelVSIZE
Catalog7
Direct Sales12
Internet8

PKc PK%AOEBPS/row_functions001.htm) ABS

ABS

ABS returns the absolute value of a numeric expression.

Return Value

NUMBER

Syntax

ABS(n)

Arguments

n is any numeric expression.

Example

ABS(-15) returns the value 15.

PKbD;PK%AOEBPS/row_functions103.htm} UID

UID

UID returns a unique identifier (UID) for the session user (the user who logged on).

Return Value

INTEGER

Syntax

UID

Example

UID returns a value such as 76.

PKpPK%AOEBPS/row_functions101.htmY TRUNC (number)

TRUNC (number)

TRUNC shortens a numeric expression to a specified number of decimal places.

Return Value

NUMBER

Syntax

TRUNC(n1 [, n2 ])

Arguments

n1 is the numeric expression to be truncated.

n2 is the number of decimal places. A positive number truncates digits to the right of the decimal point, and a negative number replaces digits to the left of the decimal point. The default value is zero (0).

Examples

TRUNC(15.79) returns the value 15.

TRUNC(15.79, 1) returns the value 15.7.

TRUNC(15.79, -1) returns the value 10.

PK[`PK%AOEBPS/row_functions108.htm > WIDTH_BUCKET

WIDTH_BUCKET

WIDTH_BUCKET enables you to construct a histogram range divided into intervals of identical size. The function returns the bucket number into which the value of an expression falls.

When needed, WIDTH_BUCKET creates an underflow bucket numbered 0 and an overflow bucket numbered num_buckets+1. These buckets handle values outside the specified range and are helpful in checking the reasonableness of the end points.

Return Value

NUMBER

Syntax

WIDTH_BUCKET
   (expr, min_value, max_value, num_buckets)

Arguments

expr is the expression for which the histogram is being created. This expression must evaluate to a numeric or datetime value or to a value. If expr evaluates to null, then the function returns null.

min_value and max_value are expressions for the end points of the acceptable range for expr. Both of these expressions must evaluate to numeric or datetime values, and neither can evaluate to null.

num_buckets is an expression for the number of buckets. This expression must evaluate to a positive integer.

Example

WIDTH_BUCKET(13, 0, 20, 4) returns the value 3. It creates four buckets from 0 to 20 and sorts the value 13 into bucket 3.

WIDTH_BUCKET(-5, 0, 20, 4) returns the value 0. The value -5 is below the beginning of the range.

PKMi PK%AOEBPS/row_functions039.htmJ LPAD

LPAD

LPAD adds characters to the left of an expression to a specified length. The data type of the return value is the same as the original text.

Use RPAD to add characters to the right.

Return Value

CHAR | NCHAR | VARCHAR2 | NVARCHAR2

Syntax

LPAD(expr1, n [, expr2 ])

Arguments

expr1 is a text expression for the base string.

n is the total length of the returned expression. If expr1 is longer than n, then this function truncates expr1 to n characters.

expr2 is a text expression for the padding characters. By default, it is a space.

Example

LPAD('Page 1',15,'*.') returns the value *.*.*.*.*Page 1.

LPAD('Stay tuned', 4) returns the value Stay.

PKh xO J PK%AOEBPS/row_functions077.htm SQRT

SQRT

SQRT returns the square root of a number.

Return Value

NUMBER

Syntax

SQRT(n)

Arguments

n is a numeric expression for a positive number.

Example

SQRT(13) returns the value 3.60555128.

PKP PK%AOEBPS/row_functions096.htmc TO_TIMESTAMP_TZ

TO_TIMESTAMP_TZ

TO_TIMESTAMP_TZ converts a text expression to a value of TIMESTAMPWITHTIMEZONE data type.

Return Value

TIMESTAMP WITH TIME ZONE

Syntax

TO_TIMESTAMP_TZ(char [, fmt [ 'nlsparam' ] ])

Arguments

char is a text expression to be converted.

fmt is a datetime model format specifying the format of char. The default date format is determined implicitly by the NLS_TERRITORY initialization parameter or can be set explicitly by the NLS_DATE_FORMAT parameter. For data type formats, refer to the Oracle Database SQL Language Reference.

nlsparam specifies the language in which month and day names and abbreviations given in char. This argument has this form:

'NLS_DATE_LANGUAGE = language' 

By default, char is in the session date language.

Examples

TO_TIMESTAMP_TZ('2006-03-26 7:33:00 -4:00', 'YYYY-MM-DD HH:MI:SS TZH:TZM') returns the value 26-MAR-06 07.33.00.000000 AM -04:00.

TO_TIMESTAMP_TZ('2006-AGOSTO-13 7:33:00 -4:00', 'YYYY-MONTH-DD HH:MI:SS TZH:TZM', 'NLS_DATE_LANGUAGE=SPANISH') returns the value 13-AUG-06 07.33.00.000000 AM -04:00.

PK҈h c PK%AOEBPS/row_functions010.htm BITAND

BITAND

BITAND computes an AND operation on the bits of two nonnegative integers, and returns an integer. This function is commonly used with the DECODE function.

An AND operation compares two bit values. If both values are 1, the operator returns 1. If one or both values are 0, the operator returns 0.

Return Value

NUMBER

Syntax

BITAND(expr1, expr2) 

Arguments

expr1 and expr2 are numeric expressions for nonnegative integers.

Example

BITAND(7, 29) returns the value 5.

The binary value of 7 is 111 and of 29 is 11101. A bit-by-bit comparison generates the binary value 101, which is decimal 5.

PK)  PK%AOEBPS/row_functions016.htm CONCAT

CONCAT

CONCAT joins two expressions as a single character string. The data type of the return value is the same as the expressions, or if they are mixed, the one that results in a lossless conversion.

Return Value

CHAR | NCHAR | VARCHAR2 | NVARCHAR2

Syntax

CONCAT(char1, char2)

Arguments

char1 and char2 are text expressions.

Example

CONCAT('The current date is ', 'October 13, 2006') returns the string The current date is October 13, 2006.

PKEPK%AOEBPS/row_functions083.htm TANH

TANH

TANH returns the tangent of a hyperbolic angle.

Return Value

NUMBER

Syntax

TANH(n)

Arguments

n is a numeric expression for a hyperbolic angle.

Example

TANH(.5) returns the value 0.462117157.

PKjCPK%AOEBPS/row_functions011.htm^ CAST

CAST

CAST converts values from one data type to another.

Return Value

The data type specified by type_name.

Syntax

CAST(expr AS type_name)

Arguments

expr can be an expression in one of the data types.

type_name is one of the data types listed in Table 1-2, "Dimensional Data Types".

Table 3-1 shows which data types can be cast into which other built-in data types. NUMBER includes NUMBER, DECIMAL, and INTEGER. DATETIME includes DATE, TIMESTAMP, TIMESTAMP WITH TIMEZONE, and TIMESTAMP WITH LOCAL TIMEZONE. INTERVAL includes INTERVAL DAY TO SECOND and INTERVAL YEAR TO MONTH.

Table 3-1 Compatible Data Types

FromTo BINARY_FLOAT, BINARY_DOUBLETo CHAR, VARCHAR2To NUMBERTo DATETIME, INTERVALTo NCHAR, NVARCHAR2

BINARY_FLOAT, BINARY_DOUBLE

yes

yes

yes

no

yes

CHAR, VARCHAR2

yes

yes

yes

yes

no

NUMBER

yes

yes

yes

no

yes

DATETIME, INTERVAL

no

yes

no

yes

yes

NCHAR, NVARCHAR2

yes

no

yes

no

yes


Example

CAST('123.4567' AS NUMBER(10,2)) returns the value 123.46.

PKYPK%AOEBPS/row_functions066.htm] ROUND (date)

ROUND (date)

ROUND returns a date rounded to the unit specified by the date format.

Return Value

DATE

Syntax

ROUND(date [, fmt ])

Arguments

date is an expression that identifies a date and time.

fmt is a text literal with a date format, as described in the Oracle Database SQL Language Reference.

Examples

ROUND(SYSDATE, 'YEAR') returns the value 01-JAN-07 for any day in the last half of 2006.

ROUND(TO_DATE('13-OCT-06'), 'MONTH') returns the value 01-OCT-06.

PK-b]PK%AOEBPS/olap_functions.htm OLAP Functions

2 OLAP Functions

The OLAP functions extend the syntax of the SQL analytic functions. This syntax is familiar to SQL developers and DBAs, so you can adopt it more easily than proprietary OLAP languages and APIs. Using the OLAP functions, you can create all standard calculated measures, including rank, share, prior and future periods, period-to-date, parallel period, moving aggregates, and cumulative aggregates.

This chapter describes the OLAP functions. It contains these topics:

PK PK%AOEBPS/row_functions092.htm ^ TO_NCHAR (datetime)

TO_NCHAR (datetime)

TO_NCHAR(datetime) converts a datetime or interval value to the national character set.

Return Value

NVARCHAR2

Syntax

TO_NCHAR({ datetime | interval }
         [, fmt [, 'nlsparam' ] ]
        )

Arguments

datetime is a datetime expression to be converted to text.

interval is an interval expression to be converted to text.

fmt is a datetime model format specifying the format of char. The default date format is determined implicitly by the NLS_TERRITORY initialization parameter or can be set explicitly by the NLS_DATE_FORMAT parameter. For data type formats, refer to the Oracle Database SQL Language Reference.

nlsparam specifies the language in which month and day names and abbreviations are returned. This argument can have this form:

'NLS_DATE_LANGUAGE = language' 

By default, the return value is in the session date language.

Examples

TO_NCHAR(SYSDATE) returns a value such as 11-APR-08.

TO_NCHAR(SYSDATE, 'Day: MONTH DD, YYYY') returns a value such as Friday : APRIL 11, 2008.

TO_NCHAR(SYSDATE, 'Day: MONTH DD, YYYY', 'NLS_DATE_LANGUAGE = Spanish') returns a value such as Viernes : ABRIL 11, 2008.

PKJ+g> PK%AOEBPS/row_functions007.htmI ATAN

ATAN

ATAN calculates the angle value in radians of a specified tangent.

Use ATAN2 to retrieve a full-range (0 - 2 pi) numeric value indicating the arc tangent of a given ratio.

Return Value

NUMBER

Syntax

ATAN(n) 

Arguments

n is a numeric expression that contains the decimal value of a tangent.

Example

ATAN(.3) returns the value 0.291456794.

PK%+PK%AOEBPS/row_functions080.htm, SYSDATE

SYSDATE

SYSDATE returns the current date and time of the operating system on which the database resides. The format of the value depends on the value of the NLS_DATE_FORMAT initialization parameter.

Return Value

DATE

Syntax

SYSDATE

Examples

SYSDATE returns a value such as 13-AUG-06 with NLS_DATE_FORMAT set to DD-MON-RR.

TO_CHAR(SYSDATE, 'MM-DD-YYYY HH24:MI:SS') returns a value such as 08-13-2006 17:20:47. The date format provided in the call to TO_CHAR displays both the date and the time.

PK|eb1,PK%AOEBPS/row_functions081.htm SYSTIMESTAMP

SYSTIMESTAMP

SYSTIMESTAMP returns the system date, including fractional seconds and time zone, of the system on which the database resides.

Return Value

TIMESTAMP WITH TIME ZONE

Syntax

SYSTIMESTAMP

Example

SYSTIMESTAMP returns a value such as

13-AUG-06 05.28.10.385799 PM -08:00.

PKҥPK%AOEBPS/row_functions006.htm/ ASIN

ASIN

ASIN calculates the angle value in radians of a specified sine.

Return Value

NUMBER

Syntax

ASIN(n) 

Arguments

n is a numeric expression in the range of -1 to 1 that contains the decimal value of a sine.

Example

ASIN(.3) returns the value 0.304692654.

PK`ו4/PK %Aoa,mimetypePK%Aw*RM:iTunesMetadata.plistPK%AYuMETA-INF/container.xmlPK%A toOEBPS/row_functions032.htmPK%AǴ, ' OEBPS/row_functions104.htmPK%A$)OEBPS/row_functions031.htmPK%AܴjfaOEBPS/row_functions054.htmPK%A C(OEBPS/row_functions005.htmPK%A 0OEBPS/olap_functions020.htmPK%A5AOEBPS/row_functions035.htmPK%A6'bKto1JOEBPS/row_functions090.htmPK%AV>  QOEBPS/row_functions100.htmPK%Az<\OEBPS/row_functions013.htmPK%A[pTOdOEBPS/cover.htmPK%A"gOEBPS/row_functions019.htmPK%AHCmOEBPS/row_functions017.htmPK%A}֪}uOEBPS/row_functions105.htmPK%AOJO}OEBPS/row_functions061.htmPK%A\65 0 OEBPS/row_functions084.htmPK%A%ٰcOEBPS/row_functions053.htmPK%A<[OEBPS/row_functions076.htmPK%AVwrOEBPS/row_functions040.htmPK%A.2JOEBPS/row_functions015.htmPK%A1,'.OEBPS/row_functions044.htmPK%AY-LGOEBPS/olap_functions007.htmPK%Ax==7OEBPS/olap_functions015.htmPK%Aqj0))^4OEBPS/olap_functions004.htmPK%A<8M0H0Q^OEBPS/olap_functions013.htmPK%Aj|C>OEBPS/title.htmPK%Au@Z;U;gOEBPS/row_functions079.htmPK%A&! OEBPS/row_functions033.htmPK%Aw r wOEBPS/row_functions102.htmPK%ARXB, ' 6OEBPS/row_functions024.htmPK%AӲÍLGOEBPS/row_functions021.htmPK%Am  >OEBPS/row_functions047.htmPK%Ak8~ OEBPS/row_functions046.htmPK%ApOEBPS/olap_functions008.htmPK%AJP`0OEBPS/row_functions018.htmPK%A?h|w7OEBPS/row_functions038.htmPK%AA [?OEBPS/row_functions071.htmPK%Ao00sHOEBPS/olap_functions018.htmPK%A)yOEBPS/row_functions027.htmPK%A#OEBPS/row_functions052.htmPK%A܁PX OOOEBPS/row_functions.htmPK%AiKV&-!-OEBPS/olap_functions023.htmPK%Aa)[OEBPS/row_functions036.htmPK%AgGiOEBPS/row_functions043.htmPK%Ak|}xyOEBPS/row_functions020.htmPK%AB/' " > OEBPS/row_functions088.htmPK%A<,OEBPS/row_functions059.htmPK%AnP[V4OEBPS/row_functions009.htmPK%A;(MOJ<OEBPS/row_functions074.htmPK%A3t$$6DOEBPS/preface.htmPK%A <  >9R;OEBPS/row_functions004.htmPK%A Cp BOEBPS/row_functions022.htmPK%AO OOEBPS/row_functions098.htmPK%AGfLYOEBPS/syntax.htmPK%A5xwrjOEBPS/row_functions026.htmPK%As sOEBPS/row_functions095.htmPK%AS `\' " ~OEBPS/row_functions086.htmPK%AeKiFi8OEBPS/content.opfPK%A`l11OEBPS/olap_functions003.htmPK%A_ ##OEBPS/dcommon/prodbig.gifPK%AY@ x)OEBPS/dcommon/doclib.gifPK%A jj*OEBPS/dcommon/oracle-logo.jpgPK%A8OEBPS/dcommon/contbig.gifPK%A#OEBPS/dcommon/darbbook.cssPK%AMά""!pOEBPS/dcommon/O_signature_clr.JPGPK%APz OEBPS/dcommon/feedbck2.gifPK%A-OEBPS/dcommon/feedback.gifPK%Aː5OEBPS/dcommon/booklist.gifPK%AN61kOEBPS/dcommon/cpyr.htmPK%A!:3.OEBPS/dcommon/masterix.gifPK%AeӺ1,`OEBPS/dcommon/doccd.cssPK%A7 OEBPS/dcommon/larrow.gifPK%A#OEBPS/dcommon/indxicon.gifPK%AS'"hOEBPS/dcommon/leftnav.gifPK%Ahu,OEBPS/dcommon/uarrow.gifPK%Al-OJOEBPS/dcommon/oracle.gifPK%A(OEBPS/dcommon/index.gifPK%AGC OEBPS/dcommon/bookbig.gifPK%AJV^OEBPS/dcommon/rarrow.gifPK%A枰pkOEBPS/dcommon/mix.gifPK%Ao"nR M  OEBPS/dcommon/doccd_epub.jsPK%Av I U OEBPS/dcommon/toc.gifPK%A r~$ OEBPS/dcommon/topnav.gifPK%A1FA  OEBPS/dcommon/prodicon.gifPK%A3( #  OEBPS/dcommon/bp_layout.cssPK%Ax[?:  OEBPS/dcommon/bookicon.gifPK%Ap*c^$ OEBPS/dcommon/conticon.gifPK%Aʍ=( OEBPS/dcommon/blafdoc.cssPK%A+&  OEBPS/row_functions078.htmPK%Au3(#)) OEBPS/olap_functions001.htmPK%Aw˜<< OEBPS/toc.htmPK%Ag<< OEBPS/olap_functions024.htmPK%AxU P 2 OEBPS/row_functions070.htmPK%AOgb< OEBPS/row_functions065.htmPK%A.AE OEBPS/row_functions049.htmPK%A&k}N OEBPS/row_functions097.htmPK%AS X] OEBPS/row_functions063.htmPK%A"Asn OEBPS/row_functions069.htmPK%AJu OEBPS/row_functions073.htmPK%A2 !  ~ OEBPS/row_functions094.htmPK%A|//o OEBPS/olap_functions002.htmPK%ApupR OEBPS/row_functions008.htmPK%A OEBPS/row_functions068.htmPK%AH[lgE OEBPS/olap_functions011.htmPK%As JJ OEBPS/olap_functions017.htmPK%AM0 OEBPS/row_functions060.htmPK%ABH? OEBPS/row_functions058.htmPK%Ah F OEBPS/row_functions030.htmPK%A?0 + S OEBPS/row_functions093.htmPK%AC ID7` OEBPS/row_functions012.htmPK%A ZUg OEBPS/olap_functions006.htmPK%A#qkfk OEBPS/olap_functions005.htmPK%Aȷq OEBPS/olap_functions010.htmPK%AV- OEBPS/row_functions042.htmPK%Ac s OEBPS/row_functions107.htmPK%AbD; OEBPS/row_functions001.htmPK%Ap OEBPS/row_functions103.htmPK%A[` OEBPS/row_functions101.htmPK%AMi  OEBPS/row_functions108.htmPK%Ah xO J  OEBPS/row_functions039.htmPK%AP ) OEBPS/row_functions077.htmPK%A҈h c a OEBPS/row_functions096.htmPK%A)   OEBPS/row_functions010.htmPK%AEu OEBPS/row_functions016.htmPK%AjC$ OEBPS/row_functions083.htmPK%AY+ OEBPS/row_functions011.htmPK%A-b]E OEBPS/row_functions066.htmPK%A N OEBPS/olap_functions.htmPK%AJ+g> n OEBPS/row_functions092.htmPK%A%+z OEBPS/row_functions007.htmPK%A|eb1, OEBPS/row_functions080.htmPK%Aҥ8 OEBPS/row_functions081.htmPK%A`ו4/ OEBPS/row_functions006.htmPKR1