View Issue Details

IDProjectCategoryView StatusLast Update
0000001CachéQuality[All Projects] Rulespublic2019-03-19 17:57
ReporterkwagnerAssigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
Status newResolutionopen 
Summary0000001: Delimited Identifiers
DescriptionWe have a need for a code smell that identifies when a developer uses double quotes (“ “) within any SQL statement.
Examples:
• Using SQL.Statement class:
Set stmt = ##CLASS(%SQL.Statement).%New()
Set query = "Select Val1, Val2 FROM Table WHERE Val1=""SomeCondition"""
 
• Using embedded SQL
&SQL(SELECT Val1, Val2
                INTO :val1, :val2
                FROM Table
                WHERE Val1=”SomeCondition”)
 
• Ideally these should be :
Set stmt = ##CLASS(%SQL.Statement).%New()
Set query = "Select Val1, Val2 FROM Table WHERE Val1=’SomeCondition’"
 
&SQL(SELECT Val1, Val2
                INTO :val1, :val2
                FROM Table
                WHERE Val1=’SomeCondition’)
 
The use of delimited identifiers causes the first condition to error because you cannot use a double quote in SQL.
 
This may need to be a opt-in (manually turned on) code smell but it would be helpful for our team.
TagsNo tags attached.
Release version
TypeFeature

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2019-03-19 17:57 kwagner New Issue