|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
DB2 on AS/400 problem with sequence
I've been able to use a sequence on DB2 with the SQL 'VALUES NEXTVAL FOR TABLE', but when I execute the same SQL on the AS/400 version of DB2, I get the following sql exception:
java.sql.SQLException: [SQL0029] INTO clause missing from embedded statement. I HAVE to get the number before I actually insert the value into another table, because I create a history file based on the id generated from my sequence. How can I simply get the value of the next number in the sequence? |
|
#2
|
||||
|
||||
|
I bet it is a version problem where the AS/400 version does not support this correctly, or possibly a fixpack could solve the problem.
A simple, though not very safe, solution would be: select max(id_column) from your_table |
![]() |
| Viewing: Dev Shed Forums > Databases > DB2 Development > DB2 on AS/400 problem with sequence |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|