Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: DBMS_RANDOM
In article <8bg5jt$a3c$1_at_bob.news.rcn.net>,
"Eugene Firyago" <efiryago_at_bisys.com> wrote:
> Does anybody use DBMS_RANDOM?
>
> My task is to have numbers randomly generated between 0 and 365 in
PL/SQL. I
> tried to use DBMS_RANDOM (8.1.6) but I couldn't understand how does
it work.
> The +/- numbers it generates are so huge and have no clear dependency
on
> SEED parameter that's only one available to adjust generating.
>
> Any idea?
>
> Thanks,
> Eugene.
>
Eugene, It was a very long time ago but in college I learned the way to
produce return values within a range using a random number generator is
to take the result of the generator and divide it by the size of the
range and take the remainder, i.e., use the mod function on the result
of the call.
What do you mean by 'have no clear dependency on SEED parameter'?
-- Mark D. Powell -- The only advice that counts is the advice that you follow so follow your own advice -- Sent via Deja.com http://www.deja.com/ Before you buy.Received on Sat Mar 25 2000 - 00:00:00 CST
![]() |
![]() |