select B.*, to_char(B.Rand, '0XXXXX') Str from
(
select A.*, trunc(DBMS_RANDOM.value(A.L, A.H)) Rand from
(
select level no,
200000+level*100000 L,
200000+level*100000+50000 H
from dual connect by level <= 100
) A
) B
;
NO L H RAND STR
---------- ---------- ---------- ---------- -------
1 300000 350000 317314 04D782
2 400000 450000 408319 063AFF
3 500000 550000 538362 0836FA
4 600000 650000 633656 09AB38
5 700000 750000 724852 0B0F74
6 800000 850000 823489 0C90C1
7 900000 950000 948578 0E7962
8 1000000 1050000 1026192 0FA890
9 1100000 1150000 1107769 10E739
10 1200000 1250000 1221980 12A55C
11 1300000 1350000 1338767 146D8F
12 1400000 1450000 1418473 15A4E9
13 1500000 1550000 1522499 173B43
14 1600000 1650000 1646482 191F92
15 1700000 1750000 1746193 1AA511
16 1800000 1850000 1815369 1BB349
17 1900000 1950000 1923534 1D59CE
18 2000000 2050000 2030796 1EFCCC
19 2100000 2150000 2149042 20CAB2
20 2200000 2250000 2202140 219A1C