Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Good random number source in oracle
Others have discussed seed values for a random function.
It is also important that the algorithm generating the random number is acceptable.
Without passing judgment on dbms_random, one has the option of using the C functions "rand" or "random" as well.
These functions are available in libc.so and some documentation on them is available through "man". To make them available in Oracle, do the following:
(1) Create a library, such as TEST:ORACLE> create or replace library
libc as '/usr/lib/libc.so.1';
2 /
Library created.
(3) Create a function to use "random" as follows: TEST:ORACLE>
create or replace function random 2 return binary_integer 3 is
external library LIBC name "random" 4 calling standard c
parameters(return long);
4 /
Function created.
(5) Experiment with the new function: TEST:ORACLE> select random
from dual;
RANDOM
-- Posted via dBforums http://dbforums.comReceived on Thu May 03 2001 - 16:32:52 CDT