Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: schedule a job every 15 mins *but* only during the office hours

Re: schedule a job every 15 mins *but* only during the office hours

From: malcolm arnold <malcolmarnold_at_gmail.com>
Date: Wed, 26 Oct 2005 15:24:17 +0100
Message-ID: <fc3bda600510260724p11f74e6bm@mail.gmail.com>


> 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-l
Received on Wed Oct 26 2005 - 09:26:28 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US