Reliability rules
Reliability is a measure of how your software is capable of maintaining its level of performance under stated conditions for a stated period of time.
67 are general rules (G- codes) and 9 are APEX rules (A- codes). 6 also apply to PostgreSQL. Start with the highest-severity reliability rules below, or browse the full list.
Most severe reliability rules
- G-1060 Avoid storing ROWIDs or UROWIDs in database tables. Blocker
- G-1210 Never create a table without a primary key. Blocker
- G-1310 Never keep database objects in an invalid state. Blocker
- G-2150 Avoid comparisons with NULL value, consider using IS [NOT] NULL. Blocker
- G-2190 Avoid using ROWID or UROWID. Blocker
- G-2310 Avoid using CHAR data type. Blocker
- G-2340 Always define your VARCHAR2 variables using CHAR SEMANTIC (if not defined anchored). Blocker
- G-3110 Always specify the target columns when coding an insert statement. Blocker
- G-3145 Avoid using SELECT * directly from a table or view. Blocker
- G-3160 Avoid visible virtual columns. Blocker
All 76 reliability rules
-
G-1060 Avoid storing ROWIDs or UROWIDs in database tables.Blocker Reliability
-
G-1210 Never create a table without a primary key.Blocker Reliability
-
G-1240 Try to index foreign key columns.Major Reliability
-
G-1250 Try to define a business key for each table.Major Reliability
-
G-1310 Never keep database objects in an invalid state.Blocker Reliability
-
G-2110 Try to use anchored declarations for variables, constants and types.Major Reliability
-
G-2135 Avoid assigning values to local variables that are not used by a subsequent statement.Major Reliability
-
G-2150 Avoid comparisons with NULL value, consider using IS [NOT] NULL.Blocker Reliability
-
G-2160 Avoid initializing variables using functions in the declaration section.Critical Reliability
-
G-2190 Avoid using ROWID or UROWID.Blocker Reliability
-
G-2210 Avoid declaring NUMBER variables, constants or subtypes with no precision.Critical Reliability
-
G-2220 Try to use PLS_INTEGER instead of NUMBER for arithmetic operations with integer values.Critical Reliability
-
G-2230 Try to use SIMPLE_INTEGER datatype when appropriate.Critical Reliability
-
G-2310 Avoid using CHAR data type.Blocker Reliability
-
G-2340 Always define your VARCHAR2 variables using CHAR SEMANTIC (if not defined anchored).Blocker Reliability
-
G-3110 Always specify the target columns when coding an insert statement.Blocker Reliability
-
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-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-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-3330 Avoid autonomous transactions.Blocker Reliability
-
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-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-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-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-5010 Try to use a error/logging framework for your application.Critical Reliability
-
G-5030 Never assign predefined exception names to user defined exceptions.Blocker Reliability
-
G-5040 Avoid use of WHEN OTHERS clause in an exception section without any other specific handlers.Critical Reliability
-
G-5060 Avoid unhandled exceptions.Major Reliability
-
G-5070 Avoid using Oracle predefined exceptions.Blocker Reliability
-
G-7130 Always use parameters or pull in definitions rather than referencing external variables in a local program unit.Major Reliability
-
G-7160 Always explicitly state parameter mode.Major Reliability
-
G-7170 Avoid using an IN OUT parameter as IN or OUT only.Major Reliability
-
G-7210 Try to keep your packages small. Include only few procedures and functions that are used in the same context.Minor Reliability
-
G-7230 Avoid declaring global variables public.Major Reliability
-
G-7250 Never use RETURN in package initialization block.Major Reliability
-
G-7460 Try to define your packaged/standalone function deterministic if appropriate.Major Reliability
-
G-7730 Avoid multiple DML events per trigger.Minor Reliability
-
G-7740 Never handle multiple DML events per trigger if primary key is assigned in trigger.Critical Reliability
-
G-7810 Never use SQL inside PL/SQL to read sequence numbers (or SYSDATE).Critical Reliability
-
G-7910 Never use DML within a SQL macro.Blocker Reliability
-
G-8110 Never use SELECT COUNT(*) if you are only interested in the existence of a row.Critical Reliability
-
G-8120 Never check existence of a row to decide whether to create it or not.Critical Reliability
-
G-8410 Always use application locks to ensure a program unit is only running once at a given time.Blocker Reliability
-
G-8510 Always use dbms_application_info to track program process transiently.Critical Reliability
-
G-9020 Try to use a format model and NLS_NUMERIC_CHARACTERS in string to number conversion functions.Critical Reliability
-
G-9040 Try using FX in string to date/time conversion format model to avoid fuzzy conversion.Blocker Reliability
-
G-9600 Never define more than one comment with hints.Critical Reliability
-
G-9601 Never use unknown hints.Critical Reliability
-
G-9602 Always use the alias name instead of the table name.Critical Reliability
-
G-9603 Never reference an unknown table/alias.Critical Reliability
-
G-9604 Never use an invalid stats method.Critical Reliability
-
G-9605 Never use an invalid stats keyword.Critical Reliability
-
A-0970 New Never place branches after an unconditional branch.Major Reliability
-
A-1070 New Always reload pages with editable Interactive Grids only for success.Blocker Reliability
-
A-1390 New Avoid buttons defined by dynamic action without a dynamic action.Major Reliability
-
A-1750 New Avoid static lists without entries.Major Reliability
-
A-3060 New Always define a primary key column for editable Interactive Grids.Blocker Reliability
-
A-3090 New Never mark Interactive Grid columns with the is-readonly class as required.Major Reliability
-
A-3110 New Always define a primary key item for forms with a DML process.Blocker Reliability
-
A-3130 New Always define a primary key column for master Interactive Grids.Blocker Reliability
-
A-3220 New Avoid regions in the dialogs position without a dialog template.Major Reliability
76 total
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.
- Maintainability rules - Rules for code that is easy to read and change.
- Rules by severity - From Blocker to Info.
- Rule profiles - Essential to Extreme: which rules are checked.
- Rules by tag - Topics such as SQL, performance and naming.
- All rules - Search and filter the complete rule set.