Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to generate a random number of specified length

rogers7942Feb 18 2015 — edited Feb 18 2015

Hi Folks,

I need to sql or pl/sql code to generate random numbers of a specified length.

Original Data: 1054271840

Desired Result: A 10-digit random number

Original Data: 105

Desired Result: A 3-digit random number

BTW, the database version is 11.2.0.3.

Thanks in advance

rogers42

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 18 2015
Added on Feb 18 2015
2 comments
4,644 views