Skip Headers
Oracle® OLAP DML Reference
11g Release 2 (11.2)

Part Number E17122-07
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

RANDOM

The RANDOM function produces a number that is randomly distributed between specified low and high boundaries. Randomly generated numbers are useful when building and duplicating tests of applications. They are especially useful for simulation and forecasting applications.

Tip:

To compute the number, RANDOM uses the values of the RANDOM.SEED.1 and RANDOM.SEED.2 options and then changes the values for the next time. When you create your own seeds, set the value of both options to odd numbers. This practice enhances the randomness of the numbers that are produced.

Return Value

DECIMAL

Syntax

RANDOM([lowbound] [highbound])

Parameters

lowbound

A numeric expression that specifies the lower boundary for the random number series. The default is 0. When lowbound is NA, the RANDOM function produces NA.

highbound

A numeric expression that specifies the upper boundary for the random number series. The default is 1. When highbound is NA, the RANDOM function produces NA

Examples

Example 8-64 Producing Random Numbers

This example assigns random numbers between 100 and 200 to a variable called test, which is dimensioned by product.

test = RANDOM(100 200)
REPORT test

These statements produce a report such as the following.

PRODUCT           TEST
-------------- ----------
Tents              122.93
Canoes             176.69
Racquets           168.32
Sportswear         150.92
Footwear           187.46