Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dbms_random

Status
Not open for further replies.

wiwya

Programmer
Apr 25, 2001
4
0
0
FR
could someone tell me why this code does not work?

DECLARE
i BINARY_INTEGER;
BEGIN
dbms_random.initialize(19254);
i := dbms_random.random;
INSERT INTO my_table VALUES(i);
dbms_random.terminate;
END;

 
I think that might be it Jim. If my_table has more than one field, don't you need to list which field to store the value of i into? If it is only one field, what about trying to assign the wrong type?

(Of course, wiwya doesn't have email notification turned on, so they'll probably never read this...) Terry M. Hoey
th3856@txmail.sbc.com
While I don't mind e-mail messages, please post all questions in these forums for the benefit of all members.
 
Maybe someone clever will figure out the problem. However there would be much less guesswork if you would include in your post the error that you're getting.
 
the error I m getting is:
DBMS_RANDOM.INITIALIZE undeclared identifier,
the same for DBMS_RANDOM.RANDOM and DBMS_RANDOM.TERMINATE

thank's for your help

(I turn on my e-mail notification)
 
Karluk, is DBMS_RANDOM a "standard" package with Oracle? I guess what I mean is, is there a chance that that package wasn't installed? I am asking Karluk, cause he is more experienced at this than I am. Anyone else know, please jump in. How do you find out if a package has been installed/compiled? Terry M. Hoey
th3856@txmail.sbc.com
While I don't mind e-mail messages, please post all questions in these forums for the benefit of all members.
 
Sorry, Terry, but that's the risk you take directing a post a specific person. I didn't know which scripts to run to create dbms_random, but fortunately this issue has been addressed in thread186-69028. Please check it out for details. Many thanks, Stevecal.
 
PL/SQL procedure successfully completed.

it works !
I've runned this commands:
@utlraw.sql
@prvtrawb.plb
@dbmsoctk.sql
@prvtoctk.plb
@dbmsrand.sql

thank's for yor help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top