Skip to content

Commit 1ed709e

Browse files
Merge pull request #10 from Trivadis/feature/v4.2.1
Feature/v4.2.1
2 parents 504980b + c06c30e commit 1ed709e

File tree

4 files changed

+57
-127
lines changed

4 files changed

+57
-127
lines changed

docs/tvdcc_report.html

Lines changed: 35 additions & 34 deletions
Large diffs are not rendered by default.

docs/tvdcc_report.xlsx

3.03 KB
Binary file not shown.

parser-limitations.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ Other command separators than semicolon (`;`) are not supported. This means that
5151

5252
## SQL Terminator
5353

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.
5555

5656
## Line Continuation Character
5757

58-
Tailing whitespaces after a line continuation character (`-`) are not supported.
58+
Tailing whitespace after a line continuation character (`-`) are not supported.
5959

6060
## Slash Command
6161

62-
Tailing whitespaces after the slash command (`/`) are not supported.
62+
Tailing whitespace after the slash command (`/`) are not supported.
6363

6464
## Execute Command
6565

@@ -298,7 +298,25 @@ Since db\* CODECOP and PL/SQL Analyzer do not include a PL/SQL unwrap utility, t
298298
299299
## SQL\*Plus Substitution Variables
300300
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:
314+
315+
```sql
316+
select empno, ename
317+
from emp
318+
&after_from_clause;
319+
```
302320

303321
## Supported Oracle Versions
304322

validator-limitations.md

Lines changed: 0 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,6 @@ You might find use cases where it feels ridiculous introducing a constant for a
4545
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)
4646

4747
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-
6148
### [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.
6249

6350
How are values with dual meaning identified?
@@ -91,14 +78,6 @@ end pkg;
9178

9279
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.
9380

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-
10281
### [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.
10382

10483
This check is not implemented.
@@ -111,48 +90,12 @@ This check is not implemented.
11190

11291
Requires `CREATE TABLE` and `ALTER TABLE` parser support or access to the Oracle Data Dicionary.
11392

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-
14693
### [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.
14794

14895
This check is not implemented.
14996

15097
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.
15198

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-
15699
### [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.
157100

158101
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;
207150

208151
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.
209152

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-
214153
### [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.
215154

216155
This check is not implemented.
217156

218157
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.
219158

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-
236159
### [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.
237160

238161
This check is not implemented.
@@ -244,15 +167,3 @@ Algorithms to detect wrong, missing and right usages of this pattern are virtual
244167
This check is not implemented.
245168

246169
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

Comments
 (0)