Java Mailing List Archive

http://www.dba.5341.com/

Home » Home (12/2007) » oracle l »

Re: Fun with SYSDATE, TRUNC() and rounding......

Connor McDonald

2006-05-31

Replies:



On 5/31/06, GovindanK <gkatteri@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@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@yahoo.com
web:   http://www.oracledba.co.uk

"Semper in excremento, sole profundum qui variat"
©2008 dba.5341.com - Jax Systems, LLC, U.S.A.