I have been confused when I saw DETERMINISTIC for many times. I did an experiment today. We assume that ORACLE is a DETERMINISTIC function, which is called only once in SQL. If no
I have been confused when I saw DETERMINISTIC for many times. I did an experiment today. We assume that ORACLE is a DETERMINISTIC function, which is called only once in SQL. If no
I have been confused when I saw DETERMINISTIC for many times. I did an experiment today. We assume that Oracle is a DETERMINISTIC function, which is called only once in SQL. If DETERMINISTIC is not used, the values are different. After DETERMINISTIC is used, different sessions have the same value.
SQL> create or replace function f_t (I _p int) return number DETERMINISTIC is
I _rtn number;
Begin
I _rtn: = I _p * dbms_random.value (1, 10 );
Return I _rtn;
End;
/
The function has been created.
Session1:
SQL> select LEVEL, f_t (1) FROM DUAL CONNECT BY LEVEL <= 10;
LEVEL F_T (1)
--------------------
1 2.55732959
2 2.55732959
3 2.55732959
4 2.55732959
5 2.55732959
6 2.55732959
7 2.55732959
8 2.55732959
9 2.55732959
10 2.55732959
10 rows have been selected.
Session2:
SQL> select LEVEL, f_t (1) FROM DUAL CONNECT BY LEVEL <= 10;
LEVEL F_T (1)
--------------------
1 2.55732959
2 2.55732959
3 2.55732959
4 2.55732959
5 2.55732959
6 2.55732959
7 2.55732959
8 2.55732959
9 2.55732959
10 2.55732959
10 rows have been selected.
SQL> create or replace function f_t (I _p int) return number is
I _rtn number;
Begin
I _rtn: = I _p * dbms_random.value (1, 10 );
Return I _rtn;
End;
/
The function has been created.
SQL> select LEVEL, f_t (1) FROM DUAL CONNECT BY LEVEL <= 10;
LEVEL F_T (1)
--------------------
1 8.48649118
2 8.9396978
3 2.2786135
4 5.29205905
5 5.32847713
6 8.70095819
7 6.20471031
8 2.00101537
9 3.53814265
10 3.64991086
10 rows have been selected.
Oracle 11g installation manual on RedHat Linux 5.8 _ x64 Platform
Installing Oracle 12C in Linux-6-64
Install Oracle 11gR2 (x64) in CentOS 6.4)
Steps for installing Oracle 11gR2 in vmwarevm
Install Oracle 11g XE R2 In Debian