Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: DBMS_JOB -- urgent !!!

Re: DBMS_JOB -- urgent !!!

From: Gunawan Yuwono <gyuwono_at_yahoo.com>
Date: Fri, 02 Mar 2001 16:26:37 -0800
Message-ID: <F001.002C2F61.20010302160045@fatcity.com>

My $.02:
There are two ways (that I know of):
1. The long way: create different jobs for each day like:

   INTERVAL = 'NEXT_DAY(TRUNC(SYSDATE),''MONDAY'') + 22/24'    INTERVAL = 'NEXT_DAY(TRUNC(SYSDATE),''TUESDAY'') + 22/24' 2. Create another stored procedure and submit it as a job (Note I didn't test the following stored procedure, but you should get the idea):

   CREATE OR REPLACE PROCEDURE RUN_JOB
   AS

      v_day VARCHAR2(10);
   BEGIN
      SELECT TO_CHAR(SYSDATE, 'DAY') INTO v_day FROM dual;

      IF v_day != 'SUNDAY' THEN
         <EXECUTE YOUR STORED PROCEDURE>;
      END IF;

      EXCEPTION
        WHEN OTHERS THEN
        <DO SOMETHING>;
        RAISE;

   END;
   /

And submit this stored procedure as a job everyday at 10 PM:

   INTERVAL = 'TRUNC(SYSDATE + 1) + 22/24' Does this make sense?

HTP.
Gunawan Yuwono
Oracle DBA
Kansas City, USA


Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Gunawan Yuwono
  INET: gyuwono_at_yahoo.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Fri Mar 02 2001 - 18:26:37 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US