From: Ramchandra on
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
From: Serge Rielau on
On 6/29/2010 10:05 AM, Ramchandra wrote:
> 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

 | 
Pages: 1
Prev: CLPPLus
Next: use "with ur" in a merge statement?