TyzA,
Oracle sequences have no innate ability to cycle by time -- only by value.
You can, however, cause the sequence to recylce by time in a variety of ways:
1) Use a scheduled task (in Unix, "cron") that runs at mindnight on the morning of the first day of a month that drops and re-creates the sequence at whatever starting value you want.
2) If you have either a trigger or some other PL/SQL procedure that runs regularly, you can introduce a piece of code that checks the SYSDATE, and if it is the first day of the month, it checks the date that the sequence was created (by checking the "CREATED" date in USER_OBJECTS WHERE OBJECT_NAME = '<sequence name>'), and if the the sequence has not yet been created for the month, you can create it in the PL/SQL code with this code:
Code:
EXECUTE IMMEDIATE 'create sequence <sequence name>';
Let us know if either of these methods sounds good to you.
![[santa] [santa] [santa]](/data/assets/smilies/santa.gif)
Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services:
www.dasages.com]