dbTalk Databases Forums  

db2 sequence to reset automatically

comp.databases.ibm-db2 comp.databases.ibm-db2


Discuss db2 sequence to reset automatically in the comp.databases.ibm-db2 forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ramchandra
 
Posts: n/a

Default db2 sequence to reset automatically - 06-29-2010 , 09:05 AM






Hi,

Is there any way in db2 to reset the identity/sequence to reset
automatically after some period of time??

Eg:-
the ID format is <SEQ/IDENTY>/YYYY
(001/2010,,,,002/2010....901/2010...)
after one year i want the SEQ/IDENTY to start with 001 ie :
(001/2011..002/2011)..



Regards,
Ram

Reply With Quote
  #2  
Old   
Serge Rielau
 
Posts: n/a

Default Re: db2 sequence to reset automatically - 07-01-2010 , 08:09 AM






On 6/29/2010 10:05 AM, Ramchandra wrote:
Quote:
Hi,

Is there any way in db2 to reset the identity/sequence to reset
automatically after some period of time??

Eg:-
the ID format is<SEQ/IDENTY>/YYYY
(001/2010,,,,002/2010....901/2010...)
after one year i want the SEQ/IDENTY to start with 001 ie :
(001/2011..002/2011)..
DB2 has scheduling capability. Just fire an ALTER SEQUENCE statement
from there.

Cheers
Serge

--
Serge Rielau
SQL Architect DB2 for LUW
IBM Toronto Lab

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.