| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
|
| ALTER SEQUENCE A_ID RESTART SELECT MAX(aid) + 1 FROM atable; Can I reset the sequence number like this? Thanks in advance. |
|
#2
|
| Actual what I want to do is to combine following sql into one: SELECT MAX(c.order_id) FROM customer_orders_t c ALTER SEQUENCE orders_seq RESTART WITH 57232 Get the max number of the table id, and reset the starting sequence number. Thanks. |
|
#3
|
| calvinscy-at-hotmail.com wrote: > ALTER SEQUENCE A_ID RESTART SELECT MAX(aid) + 1 FROM atable; > > Can I reset the sequence number like this? No, you can't. After RESTART must come a numeric constant and not a subselect or some other expression. http://publib.boulder.ibm.com/infoce...c/r0004200.htm -- Knut Stolze DB2 z/OS Utilities Development IBM Germany |
![]() |
| Thread Tools | |
| Display Modes | |