Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
15
Task/Random-numbers/PL-SQL/random-numbers.sql
Normal file
15
Task/Random-numbers/PL-SQL/random-numbers.sql
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
DECLARE
|
||||
--The desired collection
|
||||
type t_coll is table of number index by binary_integer;
|
||||
l_coll t_coll;
|
||||
|
||||
c_max pls_integer := 1000;
|
||||
BEGIN
|
||||
FOR l_counter IN 1 .. c_max
|
||||
LOOP
|
||||
-- dbms_random.normal delivers normal distributed random numbers with a mean of 0 and a variance of 1
|
||||
-- We just adjust the values and get the desired result:
|
||||
l_coll(l_counter) := DBMS_RANDOM.normal * 0.5 + 1;
|
||||
DBMS_OUTPUT.put_line (l_coll(l_counter));
|
||||
END LOOP;
|
||||
END;
|
||||
Loading…
Add table
Add a link
Reference in a new issue