Oracle PRAGMA COVERAGE
Version 26ai

General Information
Library Note Morgan's Library Page Header
The best Oracle News for FY2026

Oracle Database 26ai will be available on generic Linux platforms in January and soon on AIX and Windows
Purpose The COVERAGE pragma marks PL/SQL code which is infeasible to test for coverage.

The pragma marks a specific code section. Marking infeasible code improves the quality of coverage metrics used to assess how much testing has been achieved.

Unfortunately none of Oracle's documentation explains what "to test for coverage" means. We will update this page when we figure that out.
Documented No
First Available 12.2
 
COVERAGE
Not Feasible

The code, at right, is from Oracle's documentation but reformatted for readability
PRAGMA COVERAGE (<NOT_FEASIBLE | NOT_FEASIBLE_START | NOT_FEASIBILE_END>);
DECLARE
 x PLS_INTEGER := 42;
 y PLS_INTEGER;
BEGIN
  IF (x > 0) THEN
    y :=2;
  ELSE
    PRAGMA COVERAGE('NOT_FEASIBLE'); -- 1
    z:=3;
  END IF;

  IF (y > 0) THEN
    z :=2;
  ELSE
    PRAGMA COVERAGE('NOT_FEASIBLE'); -- 2
    z :=3;
  END IF;
END;
/
DECLARE
 x PLS_INTEGER := 42;
 y PLS_INTEGER;
BEGIN
  PRAGMA COVERAGE(’NOT_FEASIBLE_START’);
  IF (x > 0) THEN
    y :=2;
  ELSE
    z:=3;
  END IF;

  IF (y > 0) THEN
    z :=2;
  ELSE
    z :=3;
  END IF;
  PRAGMA COVERAGE (’NOT_FEASIBLE_END’);
END;
/

Related Topics
Built-in Functions
Built-in Packages
Database Security
Pragmas
AUTONOMOUS_TRANSACTION
PRAGMA_DEPRECATE
PRAGMA EXCEPTION_INIT
PRAGMA FIPSFLAG
PRAGMA INLINE
PRAGMA SERIALLY_REUSABLE
PRAGMA SUPPLEMENTAL_LOG_DATA
PRAGMA SUPPRESSES_WARNING_6009
What's New In 21c
What's New In 26ai

Morgan's Library Page Footer
This site is maintained by Daniel Morgan. Last Updated: This site is protected by copyright and trademark laws under U.S. and International law. © 1998-2026 Daniel A. Morgan All Rights Reserved