SQL0348N is the error message corresponding to SQLCODE -348. That message says:
SQL0348N
Quote:
NEXT VALUE expressions cannot be specified in the following contexts:
* CASE expression
* ...
|
So you have to change your statement so that NEXTVAL is not used inside the case expression. You could try to wrap it into a SELECT (untested):
Code:
UPDATE ...
SET ... = ( SELECT NEXTVAL FOR sequencea FROM sysibm.sysdummy1 WHERE col2 = 'A' ) UNION ALL ( SELECT NEXTVAL FOR sequenceb FROM sysibm.sysdummy1 WHERE col2 = 'B' )
WHERE col3 = 1