????DBMS_RANDOM??Oracle???????PL/SQL?????????????????????????????????????????
???????У?initialize??random??terminate??????Oracle11g?????????????????????????????????????????о??????
????1. INITIALIZE
?????????????????????DBMS_RANDOM????
???????????£?DBMS_RANDOM??????????????????????г????????????????????????????????????????????????????????????????????????£??????????????????????ж????????????????INITIALIZE??????????????????????????????????????????????????????ж???????????
????????
????DBMS_RANDOM.INITIALIZE (
????val IN BINARY_INTEGER);
??????????
SQL>BEGIN
2dbms_random.initialize(100);
3FORiIN1..10LOOP
4dbms_output.put_line(dbms_random.random);
5ENDLOOP;
6END;
7/
163284779
751599369
659804475
1131809137
-865013504
-407075626
2128226600
-448154892
-1371178596
472933400
PL/SQLproceduresuccessfullycompleted.
??????????????????У??????????£?????????10?????????????
????2. NORMAL
????NORMAL?????????????????????????????????????????1????????0?????????????????????68%?????-1??+1???95%????-2??+2???99%????-3??+3???
????????
????DBMS_RANDOM.NORMAL
????RETURN NUMBER;
??????????
????SQL> select dbms_random.normal from dual;
????NORMAL
????----------
????.321082788