Home

Unary prefix operators should not be repeated

Rule description

  • Unary prefix operators should not be repeated

 

Non-compliant Code Example

SELECT 
    NAME,
    ADDRESS,
    CREDIT_LIMIT       
FROM
    CUSTOMERS
WHERE NAME NOT IN (SELECT NAME FROM VENDOR WHERE NAME IS NOT NULL);  --Non compliant code (Unary prefix operator repeated)
BEGIN
  IF NOT ( NOT foo = 5 ) THEN  --Non compliant code (Unary prefix operator repeated)
   value := ++1;              --Non compliant code (Unary prefix operator repeated)
  END IF;

END;  

Compliant Code Example

SELECT 
    NAME,
    ADDRESS,
    CREDIT_LIMIT       
FROM
    CUSTOMERS
INNER JOIN VENDOR
	ON VENDOR.NAME IS NOT NULL AND VENDOR.NAME <> CUSTOMERS.NAME; --Compliant code
BEGIN
  IF foo = 5 THEN  --Compliant code
  value := +1;      --Compliant code
END IF;

END;  
Visual Expert 2020
 VEPLSQLRULE53