Rules tagged with: SQL
Integration of SQL (DQL, DML and TCL) in stored objects.
All 21 check SQL or PL/SQL code (G- codes). 9 also apply to PostgreSQL. Browse the rules below for explanations, examples and recommended fixes.
Most severe SQL rules
- G-3110 Always specify the target columns when coding an insert statement. Blocker
- G-3115 Avoid self-assigning a column. Blocker
- G-3120 Always use table aliases when your SQL statement involves more than one source. Blocker
- G-3145 Avoid using SELECT * directly from a table or view. Blocker
- G-3160 Avoid visible virtual columns. Blocker
- G-3170 Always use DEFAULT ON NULL declarations to assign default values to table columns if you refuse to store NULL values. Blocker
All 21 SQL rules
-
G-3110 Always specify the target columns when coding an insert statement.Blocker Reliability
-
G-3115 Avoid self-assigning a column.Blocker Maintainability
-
G-3120 Always use table aliases when your SQL statement involves more than one source.Blocker Maintainability
-
G-3130 Try to use ANSI SQL-92 join syntax.Major Maintainability
-
G-3140 Try to use anchored records as targets for your cursors.Major Reliability
-
G-3145 Avoid using SELECT * directly from a table or view.Blocker Reliability
-
G-3150 Try to use identity columns for surrogate keys.Critical Reliability
-
G-3160 Avoid visible virtual columns.Blocker Reliability
-
G-3170 Always use DEFAULT ON NULL declarations to assign default values to table columns if you refuse to store NULL values.Blocker Reliability
-
G-3180 Always specify column names instead of positional references in ORDER BY clauses.Major Reliability
-
G-3182 Always specify column names/aliases instead of positional references in GROUP BY clauses.Blocker Reliability
-
G-3183 Always specify column aliases instead of expressions in GROUP BY clauses.Minor Maintainability
-
G-3185 Never use ROWNUM at the same query level as ORDER BY.Blocker Reliability
-
G-3190 Avoid using NATURAL JOIN.Blocker Reliability
-
G-3192 Avoid joining tables with the USING clause.Blocker Reliability
-
G-3195 Always use wildcards in a LIKE clause.Blocker Maintainability
-
G-3210 Always use BULK OPERATIONS (BULK COLLECT, FORALL) whenever you have to execute a DML statement for more than 4 times.Critical Reliability
-
G-3220 Always process saved exceptions from a FORALL statement.Critical Reliability
-
G-3310 Never commit within a cursor loop.Blocker Reliability
-
G-3320 Try to move transactions within a non-cursor loop into procedures.Major Maintainability
-
G-3330 Avoid autonomous transactions.Blocker Reliability
21 total
Related tags
Tags that appear on the same rules as SQL:
- Performance (3 shared)
- Observability (1 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.