forked from utPLSQL/utPLSQL
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathut_i_preprocess.sql
More file actions
63 lines (41 loc) · 1.57 KB
/
ut_i_preprocess.sql
File metadata and controls
63 lines (41 loc) · 1.57 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
COLUMN major NOPRINT NEW_VALUE major_v
COLUMN minor NOPRINT NEW_VALUE minor_v
--Get the major and minor versions
select major, SUBSTR(minor_version,1,instr(minor_version, '.')-1) minor
from
(
select major, substr(version, length(major)+2) minor_version
from
(
SELECT SUBSTR(version,1,instr(version, '.')-1) major, version
FROM product_component_version p
WHERE UPPER(PRODUCT) LIKE 'ORACLE%'
OR UPPER(PRODUCT) LIKE 'PERSONAL ORACLE%'
)
);
--Flags for 9.x code
COLUMN col NOPRINT NEW_VALUE start_ge_9
SELECT decode(greatest(8, &major_v), 8, '/* < v9 ', '/* >= v9 */') col
FROM dual;
COLUMN col NOPRINT NEW_VALUE end_ge_9
SELECT decode(greatest(8, &major_v), 8, '< v9 */', '/* >= v9 */') col
FROM dual;
COLUMN col NOPRINT NEW_VALUE start_lt_9
SELECT decode(greatest(8, &major_v), 8, '/* < v9 */', '/* >= v9 ') col
FROM dual;
COLUMN col NOPRINT NEW_VALUE end_lt_9
SELECT decode(greatest(8, &major_v), 8, '/* < v9 */', ' >= v9 */') col
FROM dual;
--Flags for 8.1 code
COLUMN col NOPRINT NEW_VALUE start_ge_8_1
SELECT decode(greatest(8, &major_v+(&minor_v/10)), 8, '/* < v8.1 ', '/* >= v8.1 */') col
FROM dual;
COLUMN col NOPRINT NEW_VALUE end_ge_8_1
SELECT decode(greatest(8, &major_v+(&minor_v/10)), 8, ' < v8.1 */', '/* >= v8.1 */') col
FROM dual;
COLUMN col NOPRINT NEW_VALUE start_lt_8_1
SELECT decode(greatest(8, &major_v+(&minor_v/10)), 8, '/* < v8.1 */', '/* >= v8.1 ') col
FROM dual;
COLUMN col NOPRINT NEW_VALUE end_lt_8_1
SELECT decode(greatest(8, &major_v+(&minor_v/10)), 8, '/* < v8.1 */', ' >= v8.1 */') col
FROM dual;