Skip to content

Commit

Permalink
Fix order by for reserved words
Browse files Browse the repository at this point in the history
Fixes #24
  • Loading branch information
eduard93 committed Feb 12, 2017
1 parent 5404d2e commit 58cb1ce
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Form/JSON/SQL.cls.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Is this column reference valid.
return $$$NO
}
// Get property SQL name (usually wqual to property name)
// Get property SQL name (usually equal to property name)
set currentPropertySQLName = ##class(Form.Property).getPropertySQLName(currentClass, currentProperty)
// Append property SQL name to resulting sql expression
Expand Down Expand Up @@ -211,7 +211,8 @@ w ##class(Form.JSON.SQL).ParseOrderBy("Value desc", "Form.TestRef")</Description
}
if ##class(%Dictionary.CompiledProperty).IDKEYExists(class, column) {
/// nothing to do here
set column = ##class(Form.Property).getPropertySQLName(class, column)
set:$system.SQL.IsReservedWord(column) column = """" _ column _ """"
} elseif $isValidNum(column, 0, 1) {
/// nothing to do here
} else {
Expand Down

0 comments on commit 58cb1ce

Please sign in to comment.