Insert random numbers into a table
SQL>
SQL> create table t( c1 int, c2 int, c3 int, c4 int ) storage ( freelists 10 );
Table created.
SQL>
SQL>
SQL> set echo on
SQL>
SQL>
SQL> declare
2 myNumber number;
3 begin
4 for i in 1 .. 10
5 loop
6 myNumber := dbms_random.random;
7 insert into t values( myNumber, myNumber, myNumber, myNumber );
8 end loop;
9 commit;
10 end;
11 /
PL/SQL procedure successfully completed.
SQL>
SQL> select * from t;
C1 C2 C3 C4
---------- ---------- ---------- ----------
-1.731E+09 -1.731E+09 -1.731E+09 -1.731E+09
-1.831E+09 -1.831E+09 -1.831E+09 -1.831E+09
1272757711 1272757711 1272757711 1272757711
291563057 291563057 291563057 291563057
1906157085 1906157085 1906157085 1906157085
180671850 180671850 180671850 180671850
1011541972 1011541972 1011541972 1011541972
-1.686E+09 -1.686E+09 -1.686E+09 -1.686E+09
-863840673 -863840673 -863840673 -863840673
1602415758 1602415758 1602415758 1602415758
10 rows selected.
SQL>
SQL> drop table t;
Table dropped.
SQL> --
Related examples in the same category