Home » SQL & PL/SQL » SQL & PL/SQL » How to get a random number...
How to get a random number... [message #218526] Thu, 08 February 2007 09:45 Go to next message
StefanTA650
Messages: 9
Registered: May 2005
Junior Member
Hello!
I am a bit confused so please help me

I need to generate a random number so I use the following SQL-Statement:
select dbms_random.value(0,1) from dual;

This statement works fine on machine 1 running Oracle 8.1.7 but it fails on the second machine running Oracle 8.1.6.3.0... The error message is like 'invalid column name'. Do you have any idea???

Thanks in advance for supporting me Smile

Stefan

[Updated on: Thu, 08 February 2007 09:53]

Report message to a moderator

Re: How to get a random number... [message #218530 is a reply to message #218526] Thu, 08 February 2007 09:57 Go to previous messageGo to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

As far as I know dbms_random was introduced in version 8.

if you type

SQL> desc sys.dbms_random


what does that give you ?
Re: How to get a random number... [message #218536 is a reply to message #218530] Thu, 08 February 2007 10:14 Go to previous messageGo to next message
StefanTA650
Messages: 9
Registered: May 2005
Junior Member
It says 'Object desc sys.dbms_random does not exist'
Hmm, sounds not good... How can I install or initialize it?
Re: How to get a random number... [message #218537 is a reply to message #218536] Thu, 08 February 2007 10:16 Go to previous messageGo to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

Seem like it's not installed by default in 8i
Have a look at this link
That will make it work for you

Good Luck

[Updated on: Thu, 08 February 2007 10:19]

Report message to a moderator

Re: How to get a random number... [message #218542 is a reply to message #218537] Thu, 08 February 2007 10:29 Go to previous messageGo to next message
StefanTA650
Messages: 9
Registered: May 2005
Junior Member
Hmmm, there is another problem... When connecting as 'internal' oracle asks for a password. I never heard of a password for 'internal'. Is there a default one????

Even when I try to connect as sys it say 'TNS PROTOCOL ADAPTER ERROR#... WHAT's WRONG???

[Updated on: Thu, 08 February 2007 10:39]

Report message to a moderator

Re: How to get a random number... [message #218544 is a reply to message #218526] Thu, 08 February 2007 10:40 Go to previous messageGo to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

Havent used 8i for ages but as I recall it if your are logged in as oracle on the box.
then type SVRMGR
then type connect internal


If it ask you for a password then i think the default was oracle, but im not 100%

Re: How to get a random number... [message #218636 is a reply to message #218544] Fri, 09 February 2007 01:54 Go to previous messageGo to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

Did it work out for you ?
Re: How to get a random number... [message #218637 is a reply to message #218636] Fri, 09 February 2007 01:59 Go to previous messageGo to next message
StefanTA650
Messages: 9
Registered: May 2005
Junior Member
Hi!
Yeah, finally it works!!! I had some problemes with the protocol adaptor - but I solved it Smile
I logged on to oracle as sys and that worked. Thanks a lot for helping!!!

Regards to lovely sweden!!! (I have been there several times Smile )

Stefan
Re: How to get a random number... [message #218640 is a reply to message #218637] Fri, 09 February 2007 02:03 Go to previous message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

Excellent Smile

Dont forget to visit the archipelago if you visit Sweden/Stockholm
in the summer Wink
Previous Topic: about using fm ???
Next Topic: update statement
Goto Forum:
  


Current Time: Tue Dec 06 08:35:59 CST 2016

Total time taken to generate the page: 0.29130 seconds