Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: schedule a job every 15 mins *but* only during the office hours
> Hi all,
>
> I'm trying to setup snapshots to run every 15 minutes during working hours,
> else hourly. I'm ignoring weekends for now,...
>
That's a funny one.
Your case statement is being evaluated as a parameter to dbms_job.submit, instead of being evaluated by the server after the job runs.
You want:
interval => 'case
when (to_char(sysdate,''hh24'') between 8 and 20) then ''trunc(sysdate,''''MI'''') + 15/1440' -- 15 mins else ''trunc(sysdate,''''HH24'''') + 1/24'' end'
(Note all the extra apostrophies...)
Malcolm.
-- http://www.freelists.org/webpage/oracle-lReceived on Wed Oct 26 2005 - 09:26:28 CDT
![]() |
![]() |