-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinteger_data_types.sql
More file actions
64 lines (57 loc) · 1.96 KB
/
integer_data_types.sql
File metadata and controls
64 lines (57 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
-- Integer Data Types
SET SERVEROUTPUT ON
DECLARE
l_number1 NUMBER := 1;
l_number2 NUMBER := 1;
l_integer1 INTEGER := 1;
l_integer2 INTEGER := 1;
l_pls_integer1 PLS_INTEGER := 1;
l_pls_integer2 PLS_INTEGER := 1;
l_binary_integer1 BINARY_INTEGER := 1;
l_binary_integer2 BINARY_INTEGER := 1;
l_simple_integer1 BINARY_INTEGER := 1;
l_simple_integer2 BINARY_INTEGER := 1;
l_loops NUMBER := 1000000000;
l_start NUMBER;
BEGIN
-- Time NUMBER.
l_start := DBMS_UTILITY.get_time;
FOR i IN 1 .. l_loops
LOOP
l_number1 := l_number1 + l_number2;
END LOOP;
DBMS_OUTPUT.put_line ('NUMBER : ' || TO_CHAR( (DBMS_UTILITY.get_time - l_start) / 100
, 'FM999990.00') || ' sec.' );
-- Time INTEGER.
l_start := DBMS_UTILITY.get_time;
FOR i IN 1 .. l_loops
LOOP
l_integer1 := l_integer1 + l_integer2;
END LOOP;
DBMS_OUTPUT.put_line ('INTEGER : ' || TO_CHAR( (DBMS_UTILITY.get_time - l_start) / 100
, 'FM999990.00') || ' sec.' );
-- Time PLS_INTEGER.
l_start := DBMS_UTILITY.get_time;
FOR i IN 1 .. l_loops
LOOP
l_pls_integer1 := l_pls_integer1 + l_pls_integer2;
END LOOP;
DBMS_OUTPUT.put_line ('PLS_INTEGER : ' || TO_CHAR( (DBMS_UTILITY.get_time - l_start) / 100
, 'FM999990.00') || ' sec.' );
-- Time BINARY_INTEGER.
l_start := DBMS_UTILITY.get_time;
FOR i IN 1 .. l_loops
LOOP
l_binary_integer1 := l_binary_integer1 + l_binary_integer2;
END LOOP;
DBMS_OUTPUT.put_line ('BINARY_INTEGER : ' || TO_CHAR( (DBMS_UTILITY.get_time - l_start) / 100
, 'FM999990.00') || ' sec.' );
-- Time SIMPLE_INTEGER.
l_start := DBMS_UTILITY.get_time;
FOR i IN 1 .. l_loops
LOOP
l_simple_integer1 := l_simple_integer1 + l_simple_integer2;
END LOOP;
DBMS_OUTPUT.put_line ('SIMPLE_INTEGER : ' || TO_CHAR( (DBMS_UTILITY.get_time - l_start) / 100
, 'FM999990.00') || ' sec.' );
END;