Here's a thought...create a stored procedure and run it from
the
DBMS_JOB scheduler. Start the job at 23:55, and have it
loop
internally (checking sysdate) until exactly the time you want,
then reset the sequence. Be sure to set the
DBMS_JOB.NEXT
parameter so that it starts at exactly the same time every
day.
Another idea is to run your reset script from 'cron' or
'at'
and again let the system determine when exactly to fire
the
reset.
Cheers,
Mike
-----Original Message-----
From: Burton, Laura L. [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 14, 2002 7:58 AM
To: Multiple recipients of list ORACLE-L
Subject: Trigger or ????I have a need to reset a sequence number at 00:01 everyday. I thought about creating a trigger to check the time, but thought that there might be a better way than checking the time every time a record is being added. I also thought about checking the max date on the table and comparing against the system date. When system date > max then reset the sequence number. I like this logic better and thought of holes with using the time.
The only problem I have is that this seems like a lot of overhead every time I add a record, which will be often. Is a trigger the only method available to me?
Thanks,
Laura
