DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: DBMS_JOB

  1. #1
    Join Date
    Jul 2001
    Posts
    181

    Talking

    Hi,

    I have a procedure which needs the date passed to it as an IN parameter.

    when I run it manually it works fine
    e.g exec test ('02-SEP-2002')
    How can I automate this in order to get the IN parameter for yesterdays date, generated automatically.

    Thanks in advance.

  2. #2
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    exec test(trunc(sysdate)-1)
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  3. #3
    Join Date
    Jul 2001
    Posts
    181

    DBMS_JOB

    exec test(trunc(sysdate)-1)
    do I need to change the proc, or can I use DBMS_JOB with the format you give!

    Thanks in advance

  4. #4
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Let's say you wan't the procedure TEST() to be run every day at 8:00AM by DBMS_JOB. You would submit such a job with something like:
    Code:
    declare
      x binary_integer;
    begin
      dbms_job.submit
       (job => x,
        what => 'test(trunc(sysdate)-1)',
        next_date => trunc(sysdate) + 8/24,
        interval => 'trunc(sysdate) + 8/24 + 1'
       );
      commit;
    end;
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  5. #5
    Join Date
    Jul 2001
    Posts
    181
    Thanks

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