In this blog post, let’s learn about the error message “4110 The query contains sequence functions but no SEQUENCE BY clause: name.” when working with HPE NonStop SQL/MX, the reason for the error and the solution to fix this error message.
Error Message
4110 The query contains sequence functions but no SEQUENCE BY clause: name.
Reason for the Error
You specified a query that contains a sequence function name but no SEQUENCE BY clause, which is not supported. The value of the sequence function depends on the specific sequence (order) of the rows. If no sequence is defined, the result of the sequence function is dependent on an arbitrary ordering of the rows, which could lead to unexpected results.
Solution
Correct the syntax and resubmit. For example:
>>select runningsum(a) from t1;
*** ERROR[4110] The query contains sequence functions but no SEQUENCE BY clause: RUNNINGSUM(CAT.SCH.T1.A).
To correct the query, add a SEQUENCE BY clause:
>>select runningsum(a) from t1 sequence by b