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

Re: dbms_random

From: Michel Cadot <micadot{at}altern{dot}org>
Date: Fri, 4 Feb 2005 18:37:58 +0100
Message-ID: <4203b2d9$0$543$636a15ce@news.free.fr>

"Sheela" <spathiyal_at_yahoo.ca> a écrit dans le message de news:678ae5f9.0502040800.686af540_at_posting.google.com...
| I have a question regarding dbms_random pkg.
| One jsp page needs to pull a random password from a table.
|
|
| So, first I created a table and inserted 100 passwords and used this
| sql to display the random password.
| SELECT password FROM
| ( SELECT password from px_password_selfreg ORDER BY DBMS_RANDOM.value
| )
| WHERE ROWNUM = 1;
|
| Is this enough or do I need to initialize and terminate the pkg before
| and after the use?
|
|
| Thank you in advance,
|
| sheen

From doc (Supplied PL/SQL Packages and Types Reference): <quote>
Requirements
DBMS_RANDOM must be initialized before calling the random number generator. The generator produces 8-digit integers. If the initialization subprogram is not called, then the package raises an exception.
</quote>

But if you look inside package specification, you'll see: <quote>

...

Regards
Michel Cadot Received on Fri Feb 04 2005 - 11:37:58 CST

Original text of this message

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