If PLS_INTEGER is used, Oracle uses the native machine algorithm to calculate all other numeric data types.
If PLS_INTEGER is used, Oracle uses the native machine algorithm to calculate all other numeric data types.
If PLS_INTEGER is used, Oracle uses the native machine algorithm.
All other numeric data types Use the C Language Algorithm Library like the NUMBER data type
The result is that the PLS_INTEGER value is much faster than the NUMBER integer.
In addition, PLS_INTEGER does not encounter compatibility issues when porting the hardware platform
For intensive integer operations, we recommend that you use PLS_INTEGER
However, if frequent PLS_INTEGER and NUMBER data interactions, we recommend that you use NUMBER at the beginning.
Do not use PLS_INTEGER because PLS_INTEGER is used for integer calculation and the result is rounded up.
Test the experiment:
Hr @ ORCL> ed
Wrote file afiedt. buf
1 DECLARE
2 j PLS_INTEGER: = 0;
3 BEGIN
4 FOR I IN 1 .. 1000000
5 LOOP
6 j: = I + 1;
7 IF j = 1000
8 THEN
9 dbms_output.put_line ('Hello think ');
10 end if;
11 end loop;
12 * END;
Hr @ ORCL>/
Hello Think
PL/SQL procedure successfully completed.
Elapsed: 00:00:00. 28
Hr @ ORCL> ed
Wrote file afiedt. buf
1 DECLARE
2 j NUMBER: = 0;
3 BEGIN
4 FOR I IN 1 .. 1000000
5 LOOP
6 j: = I + 1;
7 IF j = 1000
8 THEN
9 dbms_output.put_line ('Hello think ');
10 end if;
11 end loop;
12 * END;
Hr @ ORCL>/
Hello Think
PL/SQL procedure successfully completed.
Elapsed: 00:00:00. 36