Rules tagged with: Control
Control structures: cursors, conditionals and flow control.
All 26 check SQL or PL/SQL code (G- codes). Browse the rules below for explanations, examples and recommended fixes.
Most severe Control rules
- G-4120 Avoid using %NOTFOUND directly after the FETCH when working with BULK OPERATIONS and LIMIT clause. Blocker
- G-4130 Always close locally opened cursors. Blocker
- G-4140 Avoid executing any statements between a SQL operation and the usage of an implicit cursor attribute. Blocker
- G-4250 Avoid using identical conditions in different branches of the same IF or CASE statement. Blocker
- G-4350 Always use 1 as lower and COUNT() as upper bound when looping through a dense array. Blocker
- G-4387 Never use a FOR LOOP for a query that should return not more than one row. Blocker
All 26 Control rules
-
G-4110 Always use %NOTFOUND instead of NOT %FOUND to check whether a cursor returned data.Minor Maintainability
-
G-4120 Avoid using %NOTFOUND directly after the FETCH when working with BULK OPERATIONS and LIMIT clause.Blocker Reliability
-
G-4130 Always close locally opened cursors.Blocker Reliability
-
G-4140 Avoid executing any statements between a SQL operation and the usage of an implicit cursor attribute.Blocker Reliability
-
G-4210 Try to use CASE rather than an IF statement with multiple ELSIF paths.Minor Maintainability
-
G-4220 Try to use CASE rather than DECODE.Major Maintainability
-
G-4230 Always use a COALESCE instead of a NVL command, if parameter 2 of the NVL function is a function call or a SELECT statement.Critical Reliability
-
G-4240 Always use a CASE instead of a NVL2 command if parameter 2 or 3 of NVL2 is either a function call or a SELECT statement.Critical Reliability
-
G-4250 Avoid using identical conditions in different branches of the same IF or CASE statement.Blocker Maintainability
-
G-4260 Avoid inverting boolean conditions with NOT.Minor Maintainability
-
G-4270 Avoid comparing boolean values to boolean literals.Minor Maintainability
-
G-4310 Never use GOTO statements in your code.Major Maintainability
-
G-4320 Always label your loops.Minor Maintainability
-
G-4325 Never reuse labels in inner scope.Major Maintainability
-
G-4330 Always use a CURSOR FOR loop to process the complete cursor results unless you are using bulk operations.Major Maintainability
-
G-4340 Always use a NUMERIC FOR loop to process a dense array.Major Maintainability
-
G-4350 Always use 1 as lower and COUNT() as upper bound when looping through a dense array.Blocker Reliability
-
G-4360 Always use a WHILE loop to process a loose array.Critical Reliability
-
G-4365 Never use unconditional CONTINUE or EXIT in a loop.Major Maintainability
-
G-4370 Avoid using EXIT to stop loop processing unless you are in a basic loop.Major Maintainability
-
G-4375 Always use EXIT WHEN instead of an IF statement to exit from a loop.Minor Maintainability
-
G-4380 Try to label your EXIT WHEN statements.Minor Maintainability
-
G-4385 Never use a cursor for loop to check whether a cursor returns data.Critical Maintainability
-
G-4387 Never use a FOR LOOP for a query that should return not more than one row.Blocker Reliability
-
G-4390 Avoid use of unreferenced FOR loop indexes.Major Reliability
-
G-4395 Avoid hard-coded upper or lower bound values with FOR loops.Minor Maintainability
26 total
Related tags
Tags that appear on the same rules as Control:
- Performance (5 shared)
More ways to browse rules
- Trivadis PL/SQL & SQL guideline rules - Rules that implement the Trivadis coding guidelines.
- OWASP-related security rules - Rules that name an OWASP Top 10 risk category.
- Oracle APEX rules - Checks for APEX applications, pages, items and regions.
- PostgreSQL rules - Rules that also apply to PostgreSQL and PL/pgSQL.
- Security rules - All rules in the Security quality area.
- Reliability rules - Rules that prevent bugs and failures at run time.
- Maintainability rules - Rules for code that is easy to read and change.
- Rules by quality area - Security, reliability and maintainability.
- Rules by severity - From Blocker to Info.
- Rule profiles - Essential to Extreme: which rules are checked.
- All rules - Search and filter the complete rule set.