Joshua,

 

How about this:

 

CREATE OR REPLACE TRIGGER "SCOTT"."WINDOW_OPEN_TR"

�� BEFORE INSERT

����� ON "SCOTT"."ORDER_TYPE"

����� FOR EACH ROW

�DECLARE�

�� l_compare_time NUMBER;

�BEGIN�

� SELECT to_char(sysdate,'HH24')

� into l_compare_time

�FROM dual;

�IF l_compare_time between '8' and '16'

�THEN

��� :NEW.window_open := 'Y';

�ELSE

��� :NEW.window_open := 'N';

�END IF;

END;

 

John Green

SSi Technologies, North America

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Joshua Becker
Sent:
Wednesday, July 02, 2003 4:41 AM
To: Multiple recipients of list ORACLE-L
Subject: Automate an update

 

Hi all,

 

I need help in order to create a following "mechanism".

 

I have a table where is a column called window_open and it has two values 'Y' and 'N'

 

Now I need to automate the update a single row based on following rules:

 

If time is between 08:00-16:00 the value on that window_open column should be 'Y' during other period the value should be 'N'. How can I do this and automate the task...

 

Thanks in advance,

 

Joshua

G� f�re i k�n och f� din sajt v�rderad p� nolltid med Yahoo! Express

Reply via email to