how to genarate random numbers in oracle for particular row?

Answer Posted / tanoy guhasarkar

the DBMS_RANDOM package provides a built-in random number
generator utility.

Using In Side A Block:--
DECLARE
my_random BINARY_INTEGER;
BEGIN
my_random := DBMS_RANDOM.RANDOM;

dbms_output.put_line(my_random);

end ;


Executing This Code, We Will Get A Random Number Every Time...

In Side A Select Statement :--

select DBMS_RANDOM.RANDOM from dual;

Note:--

This DBMS_RANDOM package included in oracle after oracle 8.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to assign data of the deleted row to variables?

842


How to rollback the current transaction in oracle?

801


WHAT IS ecc 6.0

1940


HI Friends Myself Manoj,i am from bengaluru.i have 1 yr of exp in PLSQL but not upto the mark..now attending interviews but m not able to clear even 1 round..i have attended 3 interviews till today.purpose of writing this query is,i want to know the intreview topics that interviewer going to ask frequently,mainly SCENARIO based questions.IF anybody have any PLSQL projects please give it to me,it will helps me alot.Thanks for your patience.

1227


Explain the use of online redo log files in oracle.

807


What are set operators?

855


What is a trigger oracle?

826


What is oracle open database communication (odbc)?

785


Her departmandaki isçilerden empno' su ikinci sirada olan isçilerin empno, deptno, hiredate, sira_no bigilerini döndüren sorguyu yaziniz?

1789


If a parameter is used in a query without being previously defined, what diff. exist betw. report 2.0 and 2.5 when the query is applied ?

2072


defination of bitmap index

1839


What is the purpose of tables, private synonyms and public synonyms in Oracle?

835


How to assign a tablespace to a users in oracle?

814


What is key preserved table?

767


How do I manually uninstall oracle client?

787