Home

LIKE clauses should not start with wildcard characters

Rule description

  • LIKE clauses should not start with wildcard characters

 

Non-compliant Code Example

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

Compliant Code Example

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