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: sqlplus question

RE: sqlplus question

From: Jacques Kilchoer <Jacques.Kilchoer_at_quest.com>
Date: Mon, 28 Jan 2002 15:53:18 -0800
Message-ID: <F001.003FDF0B.20020128150525@fatcity.com>

> -----Original Message-----
> From: lhoska_at_calibresys.com [mailto:lhoska_at_calibresys.com]
>
> I need to run some script using Oracle Sqlplus.  The script
> is only suppose
> to run certain days of week.
> Does anyone have a suggestion how to do that.

  1. - Use the scheduling software for your OS to schedule an OS script/job.
  2. - Make your script into a stored procedure and use dbms_job to schedule it.
  3. - Run the script every day. Start your SQL*Plus script with the following statements: whenever sqlerror exit declare   saturday constant pls_integer := 6 ;   sunday constant pls_integer := 7 ;   today pls_integer ; begin    today := to_char (sysdate, 'D') ;    if today = saturday or today = sunday    then      raise_application_error         (-20001, 'Script should only run on weekday.') ;    end if ; end ; /
Received on Mon Jan 28 2002 - 17:53:18 CST

Original text of this message

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