AS/400 conversion of IBM UDB 7.2.2

Posted on 2004-12-01
Last Modified: 2008-01-09
I have a simple sequence in DB2 and I get the next number with the SQL: 'VALUES NEXTVAL FOR TABLE'.

On the AS/400, however, I get this error message: java.sql.SQLException: [SQL0029] INTO clause missing from embedded statement.

It seems that the AS/400 wants me to use the value in a nested insert and won't give me the value directly.

How can I get the value of the sequence without actually inserting a record into another table?
Question by:jerelw
    1 Comment
    LVL 32

    Accepted Solution

    AS400 does not support sequences until version 5.3 which came out this year, and even now I am not sure if your syntax will pass.


    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
    Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now