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: Automate an update

RE: Automate an update

From: John A. Green <jagreen_at_merlincon.com>
Date: Wed, 02 Jul 2003 10:22:19 -0700
Message-ID: <F001.005BF5F4.20030702100049@fatcity.com>

<span style='font-size:

10.0pt;font-family:Arial;color:navy'>Joshua,

<span style='font-size:

10.0pt;font-family:Arial;color:navy'> 

<span style='font-size:

10.0pt;font-family:Arial;color:navy'>How about this:

<span style='font-size:

10.0pt;font-family:Arial;color:navy'> 

<span style='font-size:

10.0pt;font-family:Arial;color:navy'>CREATE OR REPLACE TRIGGER "SCOTT"."WINDOW_OPEN_TR"
<span style='font-size:

10.0pt;font-family:Arial;color:navy'>   BEFORE INSERT

<span style='font-size:

10.0pt;font-family:Arial;color:navy'>      ON "SCOTT"."ORDER_TYPE"

<span style='font-size:

10.0pt;font-family:Arial;color:navy'>      FOR EACH ROW

<span style='font-size:

10.0pt;font-family:Arial;color:navy'> DECLARE 

<span style='font-size:

10.0pt;font-family:Arial;color:navy'>   l_compare_time NUMBER;

<span style='font-size:

10.0pt;font-family:Arial;color:navy'> BEGIN 

<span style='font-size:

10.0pt;font-family:Arial;color:navy'>  SELECT to_char(sysdate,'HH24')

<span style='font-size:

10.0pt;font-family:Arial;color:navy'>  into l_compare_time

<span style='font-size:

10.0pt;font-family:Arial;color:navy'> FROM dual;

<span style='font-size:

10.0pt;font-family:Arial;color:navy'> IF l_compare_time between '8' and '16'

<span style='font-size:

10.0pt;font-family:Arial;color:navy'> THEN

<span style='font-size:

10.0pt;font-family:Arial;color:navy'>    :NEW.window_open := 'Y';

<span style='font-size:

10.0pt;font-family:Arial;color:navy'> ELSE

<span style='font-size:

10.0pt;font-family:Arial;color:navy'>    :NEW.window_open := 'N';

<span style='font-size:

10.0pt;font-family:Arial;color:navy'> END IF;

<span style='font-size:

10.0pt;font-family:Arial;color:navy'>END;

<span style='font-size:

10.0pt;font-family:Arial;color:navy'> 

<span style='font-size:

10.0pt;font-family:Arial;color:navy'>John Green

<span style='font-size:

10.0pt;font-family:Arial;color:navy'>SSi Technologies, <font  size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;  color:navy'>North America

<span style='font-size:

10.0pt;font-family:Arial;color:navy'> 

<span

style='font-size:10.0pt;font-family:Tahoma'>-----Original Message----- From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Joshua Becker
Sent: Wednesday, July
 02, 2003<span style='font-size:10.0pt;
font-family:Tahoma'> <span
 style='font-size:10.0pt;font-family:Tahoma'>4:41 AM<font size=2 face=Tahoma>
To: Multiple recipients of list
ORACLE-L
Subject: Automate an update

<span

style='font-size:12.0pt'> 

<span

style='font-size:12.0pt'>Hi all,

<span

style='font-size:12.0pt'> 

<span

style='font-size:12.0pt'>I need help in order to create a following "mechanism".

<span

style='font-size:12.0pt'> 

<span

style='font-size:12.0pt'>I have a table where is a column called window_open and it has two values 'Y' and 'N'

<span

style='font-size:12.0pt'> 

<span

style='font-size:12.0pt'>Now I need to automate the update a single row based on following rules:

<span

style='font-size:12.0pt'> 

<span

style='font-size:12.0pt'>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...

<span

style='font-size:12.0pt'> 

<span

style='font-size:12.0pt'>Thanks in advance,

<span

style='font-size:12.0pt'> 

<span

style='font-size:12.0pt'>Joshua

<span

style='font-size:12.0pt'>Gå före i kön och få din sajt värderad på nolltid med <a href="http://se.docs.yahoo.com/info/express/help/index.html">Yahoo! Express Received on Wed Jul 02 2003 - 12:22:19 CDT

Original text of this message

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