Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: dbms_random question

Re: dbms_random question

From: Jim Kennedy <kennedy-down_with_spammers_at_attbi.com>
Date: Thu, 22 May 2003 14:22:50 GMT
Message-ID: <_25za.695898$Zo.149563@sccrnsc03>


Random does NOT mean without repeating. If you have a jar with 10 marbles and each marble has a different number on it. The random number generator is like choosing a marble and then putting the marble back in the jar and choosing again. This is called choosing with replacement. You can get the same number again. If you are looking for a random number generator that draws a new marble each time and the does not replace the marble back into the jar then you are going to have to keep track of all the marbles drawn and ignore those that came up before.
Jim

-- 
Replace part of the email address: kennedy-down_with_spammers_at_attbi.com
with family.  Remove the negative part, keep the minus sign.  You can figure
it out.
"Pavel Vetesnik" <Pavel.Vet_at_volny.cz> wrote in message
news:baigpb$2e53$1_at_ns.felk.cvut.cz...

> Hello,
>
> I want to generate a random number (to create an unique password). I
> thought, the dbms_random package was created for this purpouse.
>
> I use such code:
> ============================
> nMagic NUMBER(11);
>
> dbms_random.initialize(5);
> nMagic:=dbms_random.random;
> dbms_random.terminate;
> ============================
>
> But I always get the same number (1034085445 in this case)!
> Giving different 'seed' parameter (5 above), I can get different numbers,
> but the same 'seed' means the same number.
> So what that means? To create a random number I must pass a random number
to
> the generator?!
>
> Please can you help me with this?
> Thank you in advance,
> Pavel
>
>
Received on Thu May 22 2003 - 09:22:50 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US