Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Is there any RANDOM functions in PL/SQL?
In Oracle 8 (and up...)
> cd $ORACLE_HOME/rdbms/admin
> grep -in DBMS_RANDOM *
dbmsrand.sql:22:CREATE OR REPLACE PACKAGE dbms_random AS dbmsrand.sql:61:END dbms_random; dbmsrand.sql:63:CREATE OR REPLACE PACKAGE BODY dbms_random AS dbmsrand.sql:107:END dbms_random; dbmsrand.sql:109:DROP PUBLIC SYNONYM dbms_random; dbmsrand.sql:111:CREATE PUBLIC SYNONYM dbms_random FOR sys.dbms_random; dbmsrand.sql:113:GRANT EXECUTE ON dbms_random TO public;
SQL> desc DBMS_RANDOM
PROCEDURE INITIALIZE
Argument Name Type In/Out Default? ------------------------------ ----------------------- ------ -------- SEED BINARY_INTEGER INFUNCTION RANDOM RETURNS BINARY_INTEGER
Argument Name Type In/Out Default? ------------------------------ ----------------------- ------ -------- SEED BINARY_INTEGER INPROCEDURE TERMINATE For versions 7.x and before, visit:
http://govt.oracle.com/~tkyte/Misc/Random.html
which explains how to create your own DBMS_RANDOM package in PL/SQL.
hope this helps...
On 07 Jan 2000 17:05:03 EST, "Daniel" <delj_at_flash.net> wrote:
>No built in functions that I am aware of.
>
>Daniel
>Austin, Texas
>
>"Weidong Zhou" <weidong.zhou_at_sabre.com> wrote in message
>news:38765E7C.C0179D68_at_sabre.com...
>> My PL/SQL procedure needs a RANDOM function like random( 0, 1000 ) to
>> generate random number between 0 and 1000. Anyone knows whether ORACLE
>> has this kind functions? Thanks a lot.
>>
>> Weidong Zhou
>>
>>
>
--
Sean Dillon
Oracle Corporation
sdillon_at_us.oracle.com
Reston, VA.