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