docs.intersystems.com
Home  /  Application Development: Core Topics  /  Class Definition Reference  /  Property Keywords  /  SqlComputeCode


Class Definition Reference
SqlComputeCode
[Back]  [Next] 
InterSystems: The power behind what matters   
Search:  


Specifies code that sets the value of this property.
Usage
To specify how the property is computed, use the following syntax:
Property name As classname [ SqlComputeCode = { Set {FieldName} = Expression }, SqlComputed ];
Where:
Details
If this keyword is specified (and if SqlComputed is true), then this property is a computed property. See Defining a Computed Property in Defining and Using Classes.
For the value of this keyword, specify (in curly braces) a line of ObjectScript code that sets the value of the property, according to the following rules:
For example:
Property TestProp As %String [ SqlComputeCode = {set {*} = {OtherField}}, SqlComputed ];
For another example:
Property FullName As %String [ SqlComputeCode = {set {*}={FirstName}_" "_{LastName}}, SqlComputed ];
The code is called with a Do command.
Important:
Default
The default is an empty string.
See Also