You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: parser-limitations.md
+22-4Lines changed: 22 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -51,15 +51,15 @@ Other command separators than semicolon (`;`) are not supported. This means that
51
51
52
52
## SQL Terminator
53
53
54
-
Other SQL terminators than semicolon (`;`) are not supported. This means that the `set sqlterminator` command is ignored. Tailing whitespaces after a SQL terminator are not supported.
54
+
Other SQL terminators than semicolon (`;`) are not supported. This means that the `set sqlterminator` command is ignored. Tailing whitespace after a SQL terminator are not supported.
55
55
56
56
## Line Continuation Character
57
57
58
-
Tailing whitespaces after a line continuation character (`-`) are not supported.
58
+
Tailing whitespace after a line continuation character (`-`) are not supported.
59
59
60
60
## Slash Command
61
61
62
-
Tailing whitespaces after the slash command (`/`) are not supported.
62
+
Tailing whitespace after the slash command (`/`) are not supported.
63
63
64
64
## Execute Command
65
65
@@ -298,7 +298,25 @@ Since db\* CODECOP and PL/SQL Analyzer do not include a PL/SQL unwrap utility, t
298
298
299
299
## SQL\*Plus Substitution Variables
300
300
301
-
...
301
+
Substitution variables are supported in the SQL\*Plus grammar. This means they work when used in in SQL\*Plus commands such as `connect`.
302
+
303
+
When a substitution variable is used in commands supported by the PL/SQL grammar (e.g. the `SELECT` statement), then it can be processed only when it can be replaced by a SQL expression or a condition.
304
+
305
+
Here's an example of a supported use of substitution variables:
306
+
307
+
```sql
308
+
select &&column_name
309
+
from emp
310
+
where &&where_condition;
311
+
```
312
+
313
+
However, the following example is not supported supported and leads to a parse error:
Copy file name to clipboardExpand all lines: validator-limitations.md
-89Lines changed: 0 additions & 89 deletions
Original file line number
Diff line number
Diff line change
@@ -45,19 +45,6 @@ You might find use cases where it feels ridiculous introducing a constant for a
45
45
3. Write a own validator check, overriding the default behavior (see [this example](https://github.com/Trivadis/plsql-cop-validators/blob/main/src/main/java/com/trivadis/tvdcc/validators/OverrideTrivadisGuidelines.xtend#L67) ignoring calls of the logger framework)
46
46
47
47
It's currently not possible to configure the behavior of this guideline check.
48
-
49
-
### [G-1080](https://trivadis.github.io/plsql-and-sql-coding-guidelines/v4.0/4-language-usage/1-general/g-1080/): Avoid using the same expression on both sides of a relational comparison operator or a logical operator.
50
-
51
-
This guideline was introduced in v4.0 and the check is not yet implemented.
52
-
53
-
### [G-2135](https://trivadis.github.io/plsql-and-sql-coding-guidelines/v4.0/4-language-usage/2-variables-and-types/1-general/g-2135/): Avoid assigning values to local variables that are not used by a subsequent statement.
54
-
55
-
This guideline was introduced in v4.0 and the check is not yet implemented.
56
-
57
-
### [G-2145](https://trivadis.github.io/plsql-and-sql-coding-guidelines/v4.0/4-language-usage/2-variables-and-types/1-general/g-2145/): Never self-assign a variable.
58
-
59
-
This guideline was introduced in v4.0 and the check is not yet implemented.
60
-
61
48
### [G-2410](https://trivadis.github.io/plsql-and-sql-coding-guidelines/v4.0/4-language-usage/2-variables-and-types/4-boolean-data-types/g-2410/): Try to use boolean data type for values with dual meaning.
62
49
63
50
How are values with dual meaning identified?
@@ -91,14 +78,6 @@ end pkg;
91
78
92
79
In this case for both `l_var` declarations a G-2410 violation should be thrown. Due to the simplified analysis scope three values are found for `l_var` and therefore no violation is thrown.
93
80
94
-
### [G-2610](https://trivadis.github.io/plsql-and-sql-coding-guidelines/v4.0/4-language-usage/2-variables-and-types/6-cursor-variables/g-2610/): Never use self-defined weak ref cursor types.
95
-
96
-
This guideline was introduced in v4.0 and the check is not yet implemented.
97
-
98
-
### [G-3115](https://trivadis.github.io/plsql-and-sql-coding-guidelines/v4.0/4-language-usage/3-dml-and-sql/1-general/g-3115/): Avoid self-assigning a column.
99
-
100
-
This guideline was introduced in v4.0 and the check is not yet implemented.
101
-
102
81
### [G-3160](https://trivadis.github.io/plsql-and-sql-coding-guidelines/v4.0/4-language-usage/3-dml-and-sql/1-general/g-3160/): Avoid virtual columns to be visible.
103
82
104
83
This check is not implemented.
@@ -111,48 +90,12 @@ This check is not implemented.
111
90
112
91
Requires `CREATE TABLE` and `ALTER TABLE` parser support or access to the Oracle Data Dicionary.
113
92
114
-
### [G-3185](https://trivadis.github.io/plsql-and-sql-coding-guidelines/v4.0/4-language-usage/3-dml-and-sql/1-general/g-3185/): Never use ROWNUM at the same query level as ORDER BY.
115
-
116
-
This guideline was introduced in v4.0 and the check is not yet implemented.
117
-
118
-
### [G-3195](https://trivadis.github.io/plsql-and-sql-coding-guidelines/v4.0/4-language-usage/3-dml-and-sql/1-general/g-3195/): Always use wildcards in a LIKE clause.
119
-
120
-
This guideline was introduced in v4.0 and the check is not yet implemented.
121
-
122
-
### [G-3310](https://trivadis.github.io/plsql-and-sql-coding-guidelines/v4.0/4-language-usage/3-dml-and-sql/3-transaction-control/g-3310/): Never commit within a cursor loop.
123
-
124
-
This guideline was introduced in v4.0 and the check is not yet implemented.
125
-
126
-
### [G-3320](https://trivadis.github.io/plsql-and-sql-coding-guidelines/v4.0/4-language-usage/3-dml-and-sql/3-transaction-control/g-3320/): Try to move transactions within a non-cursor loop into procedures.
127
-
128
-
This guideline was introduced in v4.0 and the check is not yet implemented.
129
-
130
-
### [G-4250](https://trivadis.github.io/plsql-and-sql-coding-guidelines/v4.0/4-language-usage/4-control-structures/2-case-if-decode-nvl-nvl2-coalesce/g-4250/): Avoid using identical conditions in different branches of the same IF or CASE statement.
131
-
132
-
This guideline was introduced in v4.0 and the check is not yet implemented.
133
-
134
-
### [G-4260](https://trivadis.github.io/plsql-and-sql-coding-guidelines/v4.0/4-language-usage/4-control-structures/2-case-if-decode-nvl-nvl2-coalesce/g-4260/): Avoid inverting boolean conditions with NOT.
135
-
136
-
This guideline was introduced in v4.0 and the check is not yet implemented.
137
-
138
-
### [G-4270](https://trivadis.github.io/plsql-and-sql-coding-guidelines/v4.0/4-language-usage/4-control-structures/2-case-if-decode-nvl-nvl2-coalesce/g-4270/): Avoid comparing boolean values to boolean literals.
139
-
140
-
This guideline was introduced in v4.0 and the check is not yet implemented.
141
-
142
-
### [G-4325](https://trivadis.github.io/plsql-and-sql-coding-guidelines/v4.0/4-language-usage/4-control-structures/3-flow-control/g-4325/): Never reuse labels in inner scopes.
143
-
144
-
This guideline was introduced in v4.0 and the check is not yet implemented.
145
-
146
93
### [G-5010](https://trivadis.github.io/plsql-and-sql-coding-guidelines/v4.0/4-language-usage/5-exception-handling/g-5010/): Try to use a error/logging framework for your application.
147
94
148
95
This check is not implemented.
149
96
150
97
Requires further definition regarding naming of the error/logging framework and its minimal use in PL/SQL code. However, could be implemented as a custom validator.
151
98
152
-
### [G-5080](https://trivadis.github.io/plsql-and-sql-coding-guidelines/v4.0/4-language-usage/5-exception-handling/g-5080/): Always use FORMAT_ERROR_BACKTRACE when using FORMAT_ERROR_STACK or SQLERRM.
153
-
154
-
This guideline was introduced in v4.0 and the check is not yet implemented.
155
-
156
99
### [G-7140](https://trivadis.github.io/plsql-and-sql-coding-guidelines/v4.0/4-language-usage/7-stored-objects/1-general/g-7140/): Always ensure that locally defined procedures or functions are referenced.
157
100
158
101
This guideline is checked for CreateFunction, CreatePackageBody, CreateProcedure, CreateTrigger, CreateTypeBody and PlsqlUnit with a simplified scope. Variable declarations and usages are identified by name. The real PL/SQL scope is not honored. This might lead to false negatives. Here's an example:
@@ -207,32 +150,12 @@ end pkg;
207
150
208
151
In the first procedure `p` the parameter `in_param` is not used. However, it is not reported due to the simplified analysis scope. Another procedure `p` has also a parameter `in_param` that has been used.
209
152
210
-
### [G-7125](https://trivadis.github.io/plsql-and-sql-coding-guidelines/v4.0/4-language-usage/7-stored-objects/1-general/g-7125/): Always use CREATE OR REPLACE instead of CREATE alone.
211
-
212
-
This guideline was introduced in v4.0 and the check is not yet implemented.
213
-
214
153
### [G-7170](https://trivadis.github.io/plsql-and-sql-coding-guidelines/v4.0/4-language-usage/7-stored-objects/1-general/g-7170/): Avoid using an IN OUT parameter as IN or OUT only.
215
154
216
155
This check is not implemented.
217
156
218
157
We cannot determine the usage of an `in out` parameter in a reliable way, especially when other units are involved which are maintained in another file.
219
158
220
-
### [G-7250](https://trivadis.github.io/plsql-and-sql-coding-guidelines/v4.0/4-language-usage/7-stored-objects/2-packages/g-7250/): Never use RETURN in package initialization block.
221
-
222
-
This guideline was introduced in v4.0 and the check is not yet implemented.
223
-
224
-
### [G-7330](https://trivadis.github.io/plsql-and-sql-coding-guidelines/v4.0/4-language-usage/7-stored-objects/3-procedures/g-7330/): Always assign values to OUT parameters.
225
-
226
-
This guideline was introduced in v4.0 and the check is not yet implemented.
227
-
228
-
### [G-7720](https://trivadis.github.io/plsql-and-sql-coding-guidelines/v4.0/4-language-usage/7-stored-objects/7-triggers/g-7720/): Never use multiple UPDATE OF in trigger event clause.
229
-
230
-
This guideline was introduced in v4.0 and the check is not yet implemented.
231
-
232
-
### [G-7730](https://trivadis.github.io/plsql-and-sql-coding-guidelines/v4.0/4-language-usage/7-stored-objects/7-triggers/g-7730/): Avoid multiple DML events per trigger if primary key is assigned in trigger.
233
-
234
-
This guideline was introduced in v4.0 and the check is not yet implemented.
235
-
236
159
### [G-8410](https://trivadis.github.io/plsql-and-sql-coding-guidelines/v4.0/4-language-usage/8-patterns/4-ensure-single-execution-at-a-time-of-a-program-unit/g-8410/): Always use application locks to ensure a program unit only running once at a given time.
237
160
238
161
This check is not implemented.
@@ -244,15 +167,3 @@ Algorithms to detect wrong, missing and right usages of this pattern are virtual
244
167
This check is not implemented.
245
168
246
169
Algorithms to detect wrong, missing and right usages of this pattern are virtually impossible to implement without understanding the context of a certain PL/SQL code.
247
-
248
-
### [G-9010](https://trivadis.github.io/plsql-and-sql-coding-guidelines/v4.0/4-language-usage/9-function-usage/g-9010/): Always use a format model in string to date/time conversion functions.
249
-
250
-
This guideline was introduced in v4.0 and the check is not yet implemented.
251
-
252
-
### [G-9020](https://trivadis.github.io/plsql-and-sql-coding-guidelines/v4.0/4-language-usage/9-function-usage/g-9020/): Try to use a format model and NLS_NUMERIC_CHARACTERS in string to number conversion functions.
253
-
254
-
This guideline was introduced in v4.0 and the check is not yet implemented.
255
-
256
-
### [G-9030](https://trivadis.github.io/plsql-and-sql-coding-guidelines/v4.0/4-language-usage/9-function-usage/g-9030/): Try to define a default value on conversion errors.
257
-
258
-
This guideline was introduced in v4.0 and the check is not yet implemented.
0 commit comments