HPE NonStop SQL/MX Error – 4111 The query contains a SEQUENCE BY clause but no sequence functions.

In this blog post, let’s learn about the error message “4111 The query contains a SEQUENCE BY clause but no sequence functions.” when working with HPE NonStop SQL/MX, the reason for the error and the solution to fix this error message.

Error Message

4111 The query contains a SEQUENCE BY clause but no sequence functions.

Reason for the Error

You specified a query that contained a SEQUENCE BY clause but no sequence functions, which is not supported. The purpose of the SEQUENCE BY clause is to specify an ordering for computing one or more sequence functions. Without sequence functions, the SEQUENCE BY clause has no effect.

Solution

Correct the syntax by adding a sequence function to the query or by using an ORDER BY (if you intend to order the result set.) For example:

>>select a from T1 sequence by a;
*** ERROR[4111] The query contains a SEQUENCE BY clause but no sequence functions.
*** ERROR[8822] Unable to prepare the statement.

Correct the syntax with one of the following:

>>select a, runningavg(c) from T1 sequence by a;
>>select a from T1 order by a

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

In this blog post, let’s learn about the error message “1104 Default value string is too long for column column-name.”...
  • Data
  • December 3, 2024
In this blog post, let’s learn about the error message “3165 The precision or exponent value specified in value was...
  • Data
  • December 3, 2024
In this blog post, let’s learn about the error message “2051 Either control optionoption name or value ‘value’is not valid.”...
  • Data
  • December 3, 2024