-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestcase.sql
96 lines (85 loc) · 1.78 KB
/
testcase.sql
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
SELECT DECODE(1 /* , () ' hello () ' */ , 1 , 'Return a string )' , 'else return something with ticks and a parenthesis '')''') FROM DUAL;
select decode /*(*/ (1 , 1 , 'what') from dual;
SELECT
-- THIS DECODE( statement should not be included
DECODE( 1 , 1 , 'But this one should' )
FROM DUAL;
/*
/*
and a nested comment , lets try some DECODE(
*/
And another decode( 'with unbalanced parenthesis' , 'inside a comment' , 'should not be converted'
*/
SELECT
DECODE(
DECODE( 1 , 1 , '( phony retval' ) ,
-- Comment/newlines shoule be ignored
'' , '' , 'y0 dAwG - I heard you liked decoeds - so I put a decode in your decode'
)
FROM DUAL;
SELECT DECODE( NVL(1,1) , 1 , 'foo', 2 , NVL('','bar') ) FROM DUAL;
SELECT
id AS "DECODE(",
decode ( decode ( status,
'A',
'A',
'B',
'B',
'other' )
,
'A',
'Accepted',
'D',
'Denied',
'Other' ) AS ")"
FROM
contracts;
SELECT
id AS "decode(",
decode ( decode ( status,
'A',
'A',
'B',
'B',
'other' )
,
'A',
'Accepted',
'D',
'Denied',
'Other' ) AS ")"
FROM
contracts;
SELECT
id AS "decode",
decode ( decode ( status,
'A',
'A',
'B',
'B',
'other' )
,
'A',
'Accepted',
'D',
'Denied',
'Other' ) AS ")"
FROM
contracts;
SELECT
id AS /* asdf1 */ -- asdf2
decode,
decode ( decode ( status,
'A',
'A',
'B',
'B',
'other' )
,
'A',
'Accepted',
'D',
'Denied',
'Other' ) AS change
FROM
contracts;