Skip to main content


Specify operator precedence for SQL queries.


[SQL]    ANSIPrecedence=n

n is either 1 or 0. The default value is 1.


When ANSIPrecedence is enabled (n = 1), InterSystems SQL uses ANSI precedence of arithmetic operators. If ANSIPrecedence is disabled (n = 0), InterSystems SQL executes arithmetic expressions in strict left-to-right order. This is an instance-wide configuration setting.

When ANSI precedence is configured, the “*”, “\”, “/”, and “#” operators have a higher precedence than the “+”, “-”, and “||” operators. Operators with a higher precedence are executed before operators with a lower precedence. You can use parentheses to override precedence when desired.

For further details, refer to the Operator Precedence section of the Using InterSystems SQL Guide.

Changing This Parameter

To set the desired value for ANSIPrecedence from the Terminal, use the SetOption(“ANSIPrecedence”)Opens in a new tab method of the %SYSTEM.SQL.UtilOpens in a new tab class. See the class reference for details.

You can also change ANSIPrecedence with the Config.SQLOpens in a new tab class (as described in the class reference) or by editing the CPF in a text editor (as described in the Editing the Active CPF section of the “Introduction to the Configuration Parameter File” chapter in this book).

See Also

FeedbackOpens in a new tab