Title: RE: sqlplus question

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
>
> 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.


a) - Use the scheduling software for your OS to schedule an OS script/job.
b) - Make your script into a stored procedure and use dbms_job to schedule it.
c) - 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 ;
/

Reply via email to