Mixing Object syntax with SQL is one of the nice features in Object Script. But in one case, it gave strange results, so I decided to isolate the case and describe it here.
Let's say you need to write a classmethod that updates a single property on disk. Usually, i would write that using SQL like this :
{
&sql(Update Test.Customer Set Active=1 Where ID=:customerId)
If SQLCODE'=0 {
Set exception = ##class(%Exception.SQL).CreateFromSQLCODE(SQLCODE, $Get(%msg))
Quit exception.AsStatus()
} Else {
Quit $$$OK
}
}