Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for NEXTVAL property in DB2 mode #3515

Closed
kdebski85 opened this issue May 20, 2022 · 2 comments · Fixed by #3516
Closed

Support for NEXTVAL property in DB2 mode #3515

kdebski85 opened this issue May 20, 2022 · 2 comments · Fixed by #3516

Comments

@kdebski85
Copy link

kdebski85 commented May 20, 2022

I use H2 in DB2 mode for tests.

I am getting the next value for a sequence with:
SELECT TEST_SEQUENCE.NEXTVAL FROM SYSIBM.SYSDUMMY1

It worked fine for both DB2 (LUW) and H2 (in DB2 mode).
After I upgraded H2 to 2.1.212, it stopped working.

http://www.h2database.com/html/migration-to-v2.html says that
Undocumented Oracle-style .NEXTVAL and .CURRVAL expressions are restricted to Oracle compatibility mode.

However, this expression should also work in DB2 mode because it works on real DB2.

@kdebski85 kdebski85 changed the title Support for NEXTVAL property in DB2 Support for NEXTVAL property in DB2 mode May 20, 2022
@katzyn
Copy link
Contributor

katzyn commented May 20, 2022

Do you really need to use that weird command instead of fully standard-compliant

VALUES NEXT VALUE FOR sequenceName;

that works in both DB2 and H2?

@kdebski85
Copy link
Author

Thank you.
I will change to use VALUES NEXT VALUE FOR sequenceName in my code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants