dbms_lock.sleep is notoriously inaccurate for large
time scales... presumably it just counts some sort of
ticks and makes assumptions from there.
If you want to sleep for 6 hours, you'd be better
issuing 6x12x5min sleeps
hth
connor
- Jared Still <jkstill_at_cybcon.com> wrote: >
> OK, so my code is too complex. :)
>
> Do you know why dbms_lock.sleep doesn' twork?
>
> Jared
>
> On Thursday 31 October 2002 15:04, Khedr, Waleed
> wrote:
> > Hi Jared,
> >
> > You do not need the "to_date" function, just:
> >
> > select (trunc(sysdate)+(10/24) - sysdate ) * (
> 24*60*60) into seconds from
> > dual;
> >
> > Regards,
> >
> > Waleed
> >
> > -----Original Message-----
> > Sent: Thursday, October 31, 2002 5:35 PM
> > To: Multiple recipients of list ORACLE-L
> >
> >
> > Dear List,
> >
> > I wrote the following bit of code yesterday to
> cause a
> > process to kick off at a particular time. This
> was not
> > doable via DBMS_JOB, as the code that follows this
> bit
> > is a sqlplus script from an app vendor.
> >
> > When I ran this last night, I expected it to sleep
> til 20:00.
> >
> > Instead, it slept for about 45 minutes.
> >
> > Here's an example from this morning that should
> have slept
> > until 10:00 AM, but instead only slept 25 minutes.
> >
> > Any ideas? Did I code something wrong here?
> >
> > This is 8.1.6.3 on Windows NT 4 SP 6.
> >
> > Just change the '10' below to some hour > sysdate
> >
> > Thanks,
> >
> > Jared
> >
> >
>
> >
> > declare
> > seconds integer;
> > begin
> > -- seconds from now til 10:00 AM
> > select (to_date(trunc(sysdate)+(10/24)) -
> sysdate ) * ( 24*60*60)
> > into seconds
> > from dual;
> > dbms_output.put_line(seconds);
> > dbms_lock.sleep(seconds);
> > end;
> >
> > 09:10:15 RSYS13 - agile_at_orcl SQL> /
> > 2681
> >
> > PL/SQL procedure successfully completed.
> >
> > 09:36:05 RSYS13 - agile_at_orcl SQL> select 2861/3600
> from dual;
> >
> > 2861/3600
> > ----------
> > .794722222
> >
> > 1 row selected.
> >
> > 14:13:02 RSYS13 - agile_at_orcl SQL>
> --
> Please see the official ORACLE-L FAQ:
> http://www.orafaq.com
> --
> Author: Jared Still
> INET: jkstill_at_cybcon.com
>
> Fat City Network Services -- 858-538-5051
> http://www.fatcity.com
> San Diego, California -- Mailing list and web
> hosting services
>
> To REMOVE yourself from this mailing list, send an
> E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of
> 'ListGuru') and in
> the message BODY, include a line containing: UNSUB
> ORACLE-L
> (or the name of mailing list you want to be removed
> from). You may
> also send the HELP command for other information
> (like subscribing).
Connor McDonald
http://www.oracledba.co.uk
http://www.oaktable.net
"GIVE a man a fish and he will eat for a day. But TEACH him how to fish, and...he will sit in a boat and drink beer all day"
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: =?iso-8859-1?q?Connor=20McDonald?=
INET: hamcdc_at_yahoo.co.uk
Fat City Network Services -- 858-538-5051 http://www.fatcity.com
San Diego, California -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
Received on Fri Nov 01 2002 - 07:43:26 CST