16
The current query would generate a key size of %d for a work table. This exceeds the maximum allowable limit of %d.
When you execute a query, Adaptive Server may need to create work tables to temporarily store query results. For example, a work table is used when duplicate rows must be removed in processing a query with an aggregate function. A sysindexes row is built for the work table after checking that the specified command does not violate any limitations on keys for user tables.
Error 414 is raised when you execute a query containing an aggregate function, and the total length of columns named in the group by clause of the query exceeds the maximum limit. The maximum limit depends on the Adaptive Server page size:
Adaptive Server page |
Maximum bytes |
---|---|
2K |
600 |
4K |
1250 |
8K |
2600 |
16K |
5300 |
Check the command for possible violations of the maximum size limit. You can correct the problem by doing one of the following:
Reduce the columns named in the group by clause until the combined column length is no more than the maximum number of bytes for the Adaptive Server page size.
If it is necessary to group by a large character column, consider using the substring string function on the column in the group by clause. This allows Adaptive Server to build a composite key to group the result set using only a portion of the character string. For example:
1> select * from titles 2> group by title, substring(notes,1,10)
This query uses only the first 10 bytes of notes (a 200 byte varchar column) to group the data.
All versions