compute Clause Restrictions

Restrictions for the compute clause.

  • You cannot use more than 127 aggregate columns in a compute clause.

  • You cannot use a compute clause in a cursor declaration.

  • You can compute summary values for both expressions and columns. Any expression or column that appears in the compute clause must appear in the select list.

  • Aliases for column names are not allowed as arguments to the row aggregate in a compute clause, although you can use them in the select list, the order by clause, and the by clause of compute.

  • In a select statement with a compute clause, the order of columns in the select list overrides the order of the aggregates in the compute clause. Open Client™, JDBC, and DB-Library™ programmers must be aware of this in order to put the aggregate results in the right place.

  • You cannot use select into in the same statement as a compute clause, because statements that include compute do not generate normal tables.

  • If a compute clause includes a group by clause:
    • The compute clause cannot contain more than 255 aggregates.

    • The group by clause cannot contain more than 255 columns.

  • Columns included in a compute clause cannot be longer than 255 bytes.