Home

Quoted identifiers should not be used

Description

    The rule "Quoted identifiers should not be used" states that when writing PL/SQL code, it is best practice to avoid using quoted identifiers. Quoted identifiers are names of objects in the database that are surrounded by double quotes. These identifiers are case-sensitive and can cause confusion and errors. It is better to use unquoted identifiers, which are not case-sensitive and are easier to read and understand. Unquoted identifiers should be used whenever possible.

Key Benefits

  • Eliminates confusion: Quoted identifiers should not be used as they can lead to confusion when trying to determine the meaning of a particular identifier.
  • Improves readability: Quoted identifiers can make code more difficult to read, as it can be hard to distinguish between literal strings and identifiers.
  • Reduces errors: Quoted identifiers can lead to errors when attempting to use them in code, as they are not recognized by the language.

 

Non-compliant Code Example

SELECT Id,
DECODE (statecode, 101, 'New York', 
    201, 'New Jersey', 
    301, 'Seattle', 
    401, 'San Francisco',
    'Unknown') As
"Service Center Location"              --Non compliant code (Quoted identifiers is used)
FROM cars
WHERE cars.Id < 1775

Compliant Code Example

SELECT Id,
DECODE (statecode, 101, 'New York', 
    201, 'New Jersey', 
    301, 'Seattle', 
    401, 'San Francisco',
    'Unknown') As
Service_Center_Location              --Compliant code (Quoted identifiers is not used)
FROM cars
WHERE cars.Id < 1775
Visual Expert 2024
 VEPLSQLRULE21