Hi,
Oracle 11.2.0.1
Windows
I have a table something like this :
create table rnd (id number,rnd number);
I need a procedure something like this :
exec genrnd(200,300);
So, after executing the procedure there will be 100 rows in the rnd table and there will be unique random numbers in rnd column. Ok, suppose if I executed again something like this :
exec genrnd(173,514);
so table will be truncated, and (514-173)+1=342 rows will be in rnd table and new unique random numbers will be in rnd column.
Id column is just for purpose of order by. It will have 1,2,3,....100 or 1,2,3,4,....342 numbers.
I can get random number by this way :
select trunc(dbms_random.value(200,300)) rnd from dual;
select trunc(dbms_random.value(173,514)) rnd from dual;
but thing number should be unique in the given range, so I am not getting how this can be achieved, please help me.
Thanks.