Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2004
    Location
    Jordan
    Posts
    137

    Unanswered: Timed Database Procedure ! ! !

    hi there
    how i can create database trigger that auto fire in specific time

    thanx

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: Timed Database Procedure ! ! !

    Use the DBMS_JOB package.

  3. #3
    Join Date
    Feb 2004
    Posts
    108
    Any specific reason for having a trigger to auto fire in specific time ?

  4. #4
    Join Date
    Feb 2004
    Location
    Jordan
    Posts
    137
    Originally posted by pinakdb
    Any specific reason for having a trigger to auto fire in specific time ?
    i have auto calculation for goods lifetime, and i wanna make auto transactions every x days on every item, so i want to add 1 to the item age every day-end, and check for transaction

  5. #5
    Join Date
    Apr 2003
    Location
    Greenville, SC (USA)
    Posts
    1,155
    dbms_job running a procedure sounds like a good way to approach it....
    It can run every day at x o'clock or every sysdate + 48 (2 days, etc)

    Gregg

  6. #6
    Join Date
    Feb 2004
    Location
    Jordan
    Posts
    137

    Red face

    hi,

    would you plz give me an example how to use DBMS_JOB to call procedure
    and run this procedure every day



    thankx alot

  7. #7
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    It is of course documented in the manuals, but anyway:
    PHP Code:
    variable job number

    exec dbms_job
    .submit
       
    job => :job
       what 
    => 'myproc;',
       
    next_date => trunc(sysdate)+1+7/24,
       
    interval => 'trunc(sysdate)+1+7/24');

    commit
    This will set up a job to run at 7am tomorrow and every day after that.

Posting Permissions

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