Skip to content

Commit 58cb1ce

Browse files
committed
Fix order by for reserved words
Fixes #24
1 parent 5404d2e commit 58cb1ce

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Form/JSON/SQL.cls.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ Is this column reference valid.
138138
return $$$NO
139139
}
140140
141-
// Get property SQL name (usually wqual to property name)
141+
// Get property SQL name (usually equal to property name)
142142
set currentPropertySQLName = ##class(Form.Property).getPropertySQLName(currentClass, currentProperty)
143143
144144
// Append property SQL name to resulting sql expression
@@ -211,7 +211,8 @@ w ##class(Form.JSON.SQL).ParseOrderBy("Value desc", "Form.TestRef")</Description
211211
}
212212
213213
if ##class(%Dictionary.CompiledProperty).IDKEYExists(class, column) {
214-
/// nothing to do here
214+
set column = ##class(Form.Property).getPropertySQLName(class, column)
215+
set:$system.SQL.IsReservedWord(column) column = """" _ column _ """"
215216
} elseif $isValidNum(column, 0, 1) {
216217
/// nothing to do here
217218
} else {

0 commit comments

Comments
 (0)