Home

LIKE clauses should not be used without wildcards

Rule description

  • LIKE clauses should not be used without wildcards

 

Non-compliant Code Example

SELECT
    NAME,
    ADDRESS,
    CREDIT_LIMIT
FROM
    CUSTOMERS
Where ADDRESS like 'BUNGALOWS';          --Non compliant code (Like clause used without wild-cards)

Compliant Code Example

SELECT
    NAME,
    ADDRESS,
    CREDIT_LIMIT
FROM
    CUSTOMERS
Where ADDRESS like '%BUNGALOWS%';       --Compliant code (Like clause used with wild-cards)
Visual Expert 2020
 VEPLSQLRULE35