View Issue Details
ID: Category: Severity: Reproducibility: Date Submitted: Last Update:
3 [CachéQuality] Rules feature N/A 2019-04-01 10:31 2019-04-01 10:31
Reporter: marta.gonzalez Platform:  
Assigned To: marta.gonzalez OS:  
Priority: normal OS Version:  
Status: assigned Product Version:  
Product Build: Resolution: open  
Projection: none      
ETA: none Fixed in Version:  
    Target Version:  
Release version:
Type: Feature
Summary: Non-checked SQLCODE after &SQL execution
Description: Check that after &SQL(SELECT ...) value of SQLCODE is checked.

And I propose the new Warning rule for this:

Check for if SQLCODE after every &SQL() before the next &SQL() or before the end of the method.
Tags:
Steps To Reproduce:
Additional Information:
Attached Files:
There are no notes attached to this issue.

View Issue Details
ID: Category: Severity: Reproducibility: Date Submitted: Last Update:
2 [CachéQuality] Rules feature N/A 2019-04-01 10:29 2019-04-01 10:29
Reporter: marta.gonzalez Platform:  
Assigned To: marta.gonzalez OS:  
Priority: normal OS Version:  
Status: assigned Product Version:  
Product Build: Resolution: open  
Projection: none      
ETA: none Fixed in Version:  
    Target Version:  
Release version:
Type: Feature
Summary: Reserved word used as SQL property
Description: Properties can't be SQL reserved words. I often name properties "Date", etc. only to forget that they can't be used in SQL as is only quoted, so I need to go to Class view and rename them to something else.

To get a full list of reserved works execute:

zw ^%qCacheSQL("reservewords")

----

select * from %Library.SQLCatalog_SQLReservedWords()
$SYSTEM.SQL.IsReservedWord(word)
Tags:
Steps To Reproduce:
Additional Information:
Attached Files:
There are no notes attached to this issue.

View Issue Details
ID: Category: Severity: Reproducibility: Date Submitted: Last Update:
1 [CachéQuality] Rules feature N/A 2019-03-19 17:57 2019-03-19 17:57
Reporter: kwagner Platform:  
Assigned To: OS:  
Priority: normal OS Version:  
Status: new Product Version:  
Product Build: Resolution: open  
Projection: none      
ETA: none Fixed in Version:  
    Target Version:  
Release version:
Type: Feature
Summary: Delimited Identifiers
Description: We 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.
Tags:
Steps To Reproduce:
Additional Information:
Attached Files:
There are no notes attached to this issue.