Home

EXCEPTION_INIT -20,NNN calls should be centralized

Rule description

  • EXCEPTION_INIT -20,NNN calls should be centralized

 

Non-compliant Code Example

CREATE OR REPLACE PACKAGE error_logger_pkg 
IS 
   failure_forall   EXCEPTION;
   failure_forsome   EXCEPTION;
	  
   PRAGMA EXCEPTION_INIT (failure_forsome, -22010); 
   PRAGMA EXCEPTION_INIT (failure_forall, -22010);      --Non compliant code 
END

Compliant Code Example

CREATE OR REPLACE PACKAGE error_logger_pkg 
IS 
   failure_forall   EXCEPTION;
   failure_forsome   EXCEPTION;
	  
   PRAGMA EXCEPTION_INIT (failure_forsome, -22010); 
   PRAGMA EXCEPTION_INIT (failure_forall, -22011);       --Compliant code 
END
Visual Expert 2020
 VEPLSQLRULE39