Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Posts
    22

    Unanswered: Run job only once

    Hi,

    I want to run the job only once and that job should run 20 seconds after the below proc is executed. The code is given below.

    ----------------------
    CREATE OR REPLACE PROCEDURE SP_CREATE_JOB AS
    v_job number;
    Begin
    dbms_output.put_line('Inside procedure SP_CREATE_JOB');
    dbms_job.submit(v_job,
    'sp_write_cronfile(''E:\temp'',''xyz1.txt'');',
    sysdate,
    'null';
    End;
    ----------------------

    I am not able to set the sysdate + 20 seconds and to run only once.

    Any help is appreciated.

    'Sysdate + 20/86400' does not work.

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    1) don't use DBMS_JOB
    2) at the end of the procedure include
    DBMS_LOCK.SLEEP(20);
    INVOKE_DESIRED_PROCEDURE;
    END;


    A shovel is a decent tool for creating a hole in the ground,
    but only when the "correct" end comes into contact with the ground.

    You are attempting to use the wrong tool to solve your problem.

Posting Permissions

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