Title: RE: dbms_lock.sleep irregularities

Jared,

remove the to_date ... that is causing the problem ...

=============== DOESN'T WORK =============================
oraclei@pallas-ACPT2> sys

SQL*Plus: Release 9.2.0.1.0 - Production on Fri Nov 1 07:51:00 2002

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

Connected.
SQL> set serveroutput on
SQL> @r2

SYSTIMESTAMP
---------------------------------------------------------------------------
01-NOV-02 07.51.06.277290 AM -05:00

-28266

PL/SQL procedure successfully completed.


SYSTIMESTAMP
---------------------------------------------------------------------------
01-NOV-02 07.51.06.347844 AM -05:00

SQL> get r2
  1  select systimestamp from dual
  2  /
  3  declare
  4        seconds integer;
  5  begin
  6  -- seconds from now til 08:00 AM
  7    select (to_date(trunc(sysdate)+(8/24)) - sysdate ) * ( 24*60*60)
  8      into seconds
  9      from dual;
 10    dbms_output.put_line(seconds);
 11    dbms_lock.sleep(seconds);
 12  end;
 13  /
 14* select systimestamp from dual
SQL> exit
==================  END  =================================

and

=============== WORKS FINE ===============================
oraclei@rhea-ACPT1> sys

SQL*Plus: Release 9.2.0.1.0 - Production on Fri Nov 1 07:50:24 2002

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

Connected.
SQL> set serveroutput on
SQL> @r1

SYSTIMESTAMP
---------------------------------------------------------------------------
01-NOV-02 07.50.36.239584 AM -05:00

564

PL/SQL procedure successfully completed.


SYSTIMESTAMP
---------------------------------------------------------------------------
01-NOV-02 08.00.13.854655 AM -05:00

SQL> get r1.sql
  1  select systimestamp from dual
  2  /
  3  declare
  4        seconds integer;
  5  begin
  6  -- seconds from now til 08:00 AM
  7    select ((trunc(sysdate)+(8/24)) - sysdate ) * ( 24*60*60)
  8      into seconds
  9      from dual;
 10    dbms_output.put_line(seconds);
 11    dbms_lock.sleep(seconds);
 12  end;
 13  /
 14* select systimestamp from dual
==================  END  =================================
Raj
______________________________________________________
Rajendra Jamadagni              MIS, ESPN Inc.
Rajendra dot Jamadagni at ESPN dot com
Any opinion expressed here is personal and doesn't reflect that of ESPN Inc.
QOTD: Any clod can have facts, but having an opinion is an art!

*********************************************************************This e-mail 
message is confidential, intended only for the named recipient(s) above and may 
contain information that is privileged, attorney work product or exempt from 
disclosure under applicable law. If you have received this message in error, or are 
not the named recipient(s), please immediately notify corporate MIS at (860) 766-2000 
and delete this e-mail message from your computer, Thank 
you.*********************************************************************1


Reply via email to