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)

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
Visual Expert 2020
 VEPLSQLRULE53