Skip to Main Content
  • Questions
  • Which algorithm uses dbms_random.random

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question, Iva.

Asked: September 18, 2016 - 8:59 am UTC

Last updated: September 19, 2016 - 5:36 am UTC

Version: 12c

Viewed 1000+ times

You Asked

Hi,

I could not find in documentation. Do you know which algorithm uses dbms_random.random?

Thanks

and Chris said...

You mean, "how is dbms_random.random implemented"?

If it's not in the documentation, then it's not publicly available!

And you shouldn't really be using this anyway. As the docs say:

This function is deprecated with Release 11gR1 and, although currently supported, it should not be used.

http://docs.oracle.com/database/121/ARPLS/d_random.htm#ARPLS67499

If you want to generate a random number, use dbms_random.value instead.

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Iva Per, September 18, 2016 - 5:40 pm UTC

Thanks for the anwser.

I wanted to know which algorithm is beneath this function.
Something like linear congruential method, or something else? OK, I will use dbms_random.value, but I still would like to know which algorithm is beneath this function.



Chris Saxon
September 19, 2016 - 5:36 am UTC

Its not documented, although you might to read on the following :-)

https://en.wikipedia.org/wiki/Lagged_Fibonacci_generator

The docs *do* say it is not suitable for cryptographic purposes.

More to Explore

DBMS_RANDOM

More on PL/SQL routine DBMS_RANDOM here