SYS(3055) - FOR and WHERE Clause Complexity

Sets the complexity level of the FOR and WHERE clauses in commands and functions that support those clauses.

SYS(3055 [, nComplexity])



Specifies the complexity level. The valid range for nComplexity is 320 to 2040. The default value is 320. If you specify an odd value, it is rounded down to the closest even integer.


If you receive the error Insufficient stack space (Error 1308) or SQL: Statement too long (Error 1812), you can increase the FOR and WHERE clause complexity to help prevent the error.

For example, calling TABLEUPDATE( ) for a local table or view that doesn't use key fields generates a long WHERE clause to find the update row. The default number of fields supported in the WHERE clause is 40. If you receive the error SQL: Statement too long (Error 1812), you should either use a key field for the update or increase the complexity of the WHERE clause with SYS(3055). If you use SYS(3055), increase its value to 8 times the number of fields in the table:

= SYS(3055, 8 * MIN(40, FCOUNT( )))

If SYS(3055) is issued without the nComplexity argument, its current setting is returned.


This function also determines the number of items you can list in the IN clause of a query.

The following commands and functions support the FOR or WHERE clauses:

Community Additions