Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Fun with SYSDATE, TRUNC() and rounding......
On 5/31/06, GovindanK <gkatteri_at_fastmail.fm> wrote:
>
> Mark
>
> Useful posting this is. I wish to point to the following link (though
> it is not 100% similar, but it tells how to skip a window). Thought others
> may find it useful.
>
>
> http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:2328991547163#36924160898182
>
> HTH
>
> GovindanK
>
> On Tue, 30 May 2006 14:15:07 -0400, "Bobak, Mark" <Mark.Bobak_at_il.proquest.com> said:
>
> So, this was a fun little exercise…..
>
> Everyone knows that trunc(sysdate) will return the current date, rounded
> to midnight, that is, currently, for me, it would return '2006-05-30
> 00:00:00' (assuming your nls_date_format is set appropriately).
>
>
Once intervals etc start getting narky (ie, complex) I often find it easier
just to pass next_date to the job, ie
dbms_job.submit(:gj, 'my_proc(next_date)')
In this way, the routine itself has control over its interval so you can do all sorts of fancy things like skip times, increase or reduce frequency etc etc etc
hth
-- Connor McDonald =========================== email: connor_mcdonald_at_yahoo.com web: http://www.oracledba.co.uk "Semper in excremento, sole profundum qui variat" -- http://www.freelists.org/webpage/oracle-lReceived on Wed May 31 2006 - 00:35:59 CDT
![]() |
![]() |