Delay function?
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 8 of 8

Thread: Delay function?

  1. #1
    Join Date
    Mar 2001
    Location
    Ireland/Dublin
    Posts
    684
    Hi,
    Is there delay function in Oracle?
    Thanks

  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    dbms_lock.sleep
    Jeff Hunter
    marist89@yahoo.com
    http://marist89.blogspot.com/
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

  3. #3
    Join Date
    Aug 2001
    Posts
    134

    How I can Use this Package ?
    Any Example !
    Jani

  4. #4
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    Code:
    connect internal
    
    set serveroutput on
    begin
    dbms_output.enable(20000);
    dbms_lock.sleep(30);
    dbms_output.put_line('Hmm had a nice nap');
    end;
    /

  5. #5
    Join Date
    Jun 2001
    Location
    Helsinki. Finland
    Posts
    3,938
    Originally posted by Jani

    How I can Use this Package ?
    Any Example !
    Jani
    DECLARE
    X DATE;
    BEGIN
    SELECT SYSDATE INTO X FROM DUAL;
    DBMS_LOCK.SLEEP(12);
    END;
    /

    Oracle will wait for 12 seconds.

  6. #6
    Join Date
    Jun 2001
    Location
    Helsinki. Finland
    Posts
    3,938
    I recommend you the following book:

    Oracle Built-in Packages by Feuerstein, Steven

    Paperback. O'Reilly & Associates, US, UK, 199804.

    ISBN: 1565923758.

  7. #7
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    When using DBMS_LOCK.SLEEP one must be aware of the bug that is present in *all* Oracle editions so far, AFAIK even in 9.0.1. The bug is described at the end of the following article:

    http://www.jlcomp.demon.co.uk/faq/sleep.html
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  8. #8
    Join Date
    Jun 2001
    Location
    Helsinki. Finland
    Posts
    3,938
    Wow, you've really researched the sleep function!!

    Thanks for the link!

    Orcale Corp. should pay you for your effords!


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width