Oracle PRAGMA COVERAGE
Version 19.3

General Information
Library Note Morgan's Library Page Header
For how many years have you been working with physical servers that are starving your database of the memory necessary to deploy important new performance features such as the Result Cache, Memoptimize Pool, In-Memory Aggregation, In-Memory Column Store, and Full Database Caching? Too long? Contact me to learn how to improve all queries ... not just some queries.
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 cde, 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
AUTONOMOUS_TRANSACTION
Built-in Functions
Built-in Packages
Database Security
DEPRECATION
EXCEPTION_INIT
FIPSFLAG
INLINE
Pragmas
SERIALLY_REUSABLE
SUPPLEMENTAL_LOG_DATA
What's New In 18c
What's New In 19c

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