Home / Class Definition Reference / Property Keywords / SqlComputeCode

Class Definition Reference
Previous section           Next section
InterSystems: The power behind what matters   

Specifies code that sets the value of this property.
To specify how the property is computed, use the following syntax:
Property name As classname [ SqlComputeCode = { Set {FieldName} = Expression }, SqlComputed ];
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.
The default is an empty string.
See Also

Previous section           Next section
View this book as PDF
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA
Content Date/Time: 2019-02-21 01:13:32