I have this Trigger in the table:
[tt][blue]BEFORE UPDATE
:[/blue]NEW.RECORD_LAST_UPDATED[blue] := SYSDATE;[/blue][/tt]
which updates the field when the record is updated. Great. But at night all records in this table get updated (like clearing all locks on all records) so all records get the date/time of last update at midnight.
How do I limit of when this Trigger gets to run if I want to exclude any time between - let's say - 10:00 PM and 6:00 AM next day?
I was thinking to employ somehow:
[tt]SELECT TO_CHAR(SYSDATE, 'HH') AS MYTIME FROM DUAL[/tt]
but there may be a better way to do it....
Have fun.
---- Andy
There is a great need for a sarcasm font.
[tt][blue]BEFORE UPDATE
:[/blue]NEW.RECORD_LAST_UPDATED[blue] := SYSDATE;[/blue][/tt]
which updates the field when the record is updated. Great. But at night all records in this table get updated (like clearing all locks on all records) so all records get the date/time of last update at midnight.
How do I limit of when this Trigger gets to run if I want to exclude any time between - let's say - 10:00 PM and 6:00 AM next day?
I was thinking to employ somehow:
[tt]SELECT TO_CHAR(SYSDATE, 'HH') AS MYTIME FROM DUAL[/tt]
but there may be a better way to do it....
Have fun.
---- Andy
There is a great need for a sarcasm font.