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

Home -> Community -> Usenet -> c.d.o.server -> Re: DBMS_RANDOM package with negative random numbers ??

Re: DBMS_RANDOM package with negative random numbers ??

From: John Russell <netnews3_at_johnrussell.mailshell.com>
Date: Fri, 31 May 2002 17:09:36 GMT
Message-ID: <e3bffu4egkkmr6advh9aebqmvmu6t1dcnk@4ax.com>


On 31 May 2002 09:33:38 -0700, rolf.unger_at_ctilabs.de (Rolf Unger) wrote:
>has anybody experience with the package DBMS_RANDOM
>on Windows NT?

I'm not sure about the type conversions, but in my own code to get a random number from 1..N, I find the expression

(1+abs(mod(dbms_random.random,N)))

suggesting that you do need to ignore the sign.

John

--
Got an Oracle database question?
Try the search engine for the database docs at:
http://tahiti.oracle.com/

The opinions expressed above are mine and do not
necessarily reflect those of Oracle Corporation.
Received on Fri May 31 2002 - 12:09:36 CDT

Original text of this message

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