Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: DBMS_JOB -- urgent !!!
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;
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
-- 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
![]() |
![]() |