Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: dbms_jobs once an hour at the bottom of the hour
Michel Cadot schrieb:
> "Syltrem" <syltremzulu_at_videotron.ca> a écrit dans le message de news: 11o69aean6e1p06_at_corp.supernews.com...
> > trunc(sysdate,'HH')+decode(sign(to_number(to_char(sysdate,'MI'))-30),1,2,1)/48 > > Regards > Michel Cadot > >
Slightly different
TRUNC(SYSDATE + (30 - TO_NUMBER(TO_CHAR(SYSDATE,'MI')))/1440,'MI')
Both expressions would fail if the job was running less than 1 minute (
i.e. to_date('22.11.2005 19:30:15','dd.mm.yyyy hh24:mi:ss') will result
in 19:30 instead of 20:00 )
SYSDATE + (30 - MOD(((SYSDATE - TRUNC(SYSDATE)) * 1440),30))/1440 ( if i not made some mistake , what is good possible ;-) ) should give then next half an hour for previous example correct.
Best regards
Maxim Received on Tue Nov 22 2005 - 12:36:31 CST