niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » Oracle » Tools
dbms_random
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
Author Message
spathiyal@yahoo.ca
*nix forums beginner


Joined: 20 Jul 2005
Posts: 7

PostPosted: Fri Feb 04, 2005 2:59 pm    Post subject: dbms_random Reply with quote

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.RANDOM )
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
Back to top
Michel Cadot
*nix forums Guru


Joined: 24 Apr 2005
Posts: 457

PostPosted: Fri Feb 04, 2005 4:38 pm    Post subject: Re: dbms_random Reply with quote

"Sheela" <spathiyal@yahoo.ca> a écrit dans le message de
news:678ae5f9.0502040759.748b3178@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.RANDOM )
| 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>
-- By default, the package is initialized with the current user
-- name, current time down to the second, and the current session.
</quote>

....

Regards
Michel Cadot
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
The time now is Thu Jan 08, 2009 12:29 am | All times are GMT
navigation Forum index » Databases » Oracle » Tools
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts dbms_random spathiyal@yahoo.ca Oracle 1 Fri Feb 04, 2005 3:00 pm

Credit Card | Debt Consolidation | Bankruptcy | MPAA | Personal Finance
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1316s ][ Queries: 12 (0.0634s) ][ GZIP on - Debug on ]