Selecting from DBA_OBJECTS
My current installation has 64974 records in
dba_objects
. Thus, I can abuse
dba_objects
as a row source to generate up to 64974 records.
In order to create a table with 50000 records, I can limit the number or generated numbers with
where rownum <= 50000
:
create table tq84_xyz as
select
date '1987-01-01' + rownum dt,
round(dbms_random.value(1, 100), 2) num
from
dba_objects
where
rownum <= 50000;
If more than 64K records need to be produced,
dba_objects
can be
cross joined to itself. This produces a cartesian product, i. e. can provide up toe 64974*64974 records.
The following statement creates a table with a record for each second in the year 2023:
drop table tq84_xyz;
create table tq84_xyz as
select
date '2023-01-01' + rownum/24/60/60 dt,
rownum num
from
dba_objects cross join dba_objects
where
rownum <= 365*24*60*60 -1
;
select
min(dt),
max(dt),
count(*)
from
tq84_xyz;