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

Thread: how to run procedure based on day

  1. #1
    Join Date
    Feb 2007
    Posts
    5

    Unhappy how to run procedure based on day

    I have a main procedure called SP_MAIN, which will call the below procedures for execution everyday.
    SP_ACCT
    SP_CONSOLE
    SP_CUST
    SP_RATE
    SP_BAL
    SP_PRO
    SP_CDT

    I need only execute SP_RATE on every Tuesday on third week of the month.
    How to execute a procedure based on a specific day?
    All these procedure has dependencies, I can't take out SP_RATE from SP_MAIN as a standalone procedure. How could I include a function within the SP_MAIN to have SP_RATE only run on every Tuesday on third week of the month?

    Appreciate any suggestion given.

    thanks

    best regards,

  2. #2
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    Use TRUNC(sysdate,'MM')-1 to find the last day of the previous month. Use NEXT_DAY() to find the first Tuesday. Add 14 to find the third Tuesday. Compare with Trunc(sysdate) to see if today is the third Tuesday.
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

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