Home

Constant declarations should contain initialization assignments

Rule description

  • Constant declarations should contain initialization assignments

 

Non-compliant Code Example

DECLARE
  pi     CONSTANT REAL;     --Non compliant code (Constant declaration does not contains initialization assignments)
  radius          REAL := 1;
  area            REAL := (pi * radius**2);
BEGIN
  NULL;
END;

Compliant Code Example

DECLARE
  pi     CONSTANT REAL := 3.14159;  --Compliant code (Constant declaration contains initialization assignments)
  radius          REAL := 1;
  area            REAL := (pi * radius**2);
BEGIN
  NULL;
END;
Visual Expert 2020
 VEPLSQLRULE13