Round a random value from dbms_random.value : DBMS_RANDOM « System Packages « Oracle PL / SQL






Round a random value from dbms_random.value

   
SQL>
SQL>
SQL>     begin
  2        for i in 1 .. 10 loop
  3          dbms_output.put_line( round( dbms_random.value*100 ) );
  4        end loop;
  5      end;
  6      /
63
62
7
72
82
80
88
42
30
67

PL/SQL procedure successfully completed.

SQL>
SQL> --

   
    
  








Related examples in the same category

1.ROUND a DBMS_RANDOM.VALUE
2.This script illustrates the use of the DBMS_RANDOM package.
3.Call dbms_random.normal to get a random number
4.Use dbms_random.string to create random string
5.dbms_random.value
6.Random string with dbms_random.string
7.Seed a random value with dbms_random.seed
8.trunc a random value from dbms_random.value
9.mod(abs(dbms_random.random),50000)+1
10.Insert random numbers into a table
11.Insert random value to table