How to get the next value of sequence? Could somebody tell what is wrong with obvious query below: 

db2 =&gt; select next value for schema_name.sequence_name;


As a result I'm getting: 

SQL0104N  An unexpected token "END-OF-STATEMENT" was found following
"schema_name.sequence_name".  Expected tokens may include:  "&lt;table_expr&gt;".
SQLSTATE=42601
You need to select from something. Another option is:

db2 =&gt; values next value for schema_name.sequence_name;


As you noted you can also use SYSIBM.SYSDUMMY1 or create a virtual table:

db2 =&gt; select next value for schema_name.sequence_name from ( values 1 );