Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: URGENT: Automate an update

Re: URGENT: Automate an update

From: andrewst <member14183_at_dbforums.com>
Date: Wed, 02 Jul 2003 10:07:14 +0000
Message-ID: <3065838.1057140434@dbforums.com>

Originally posted by Kalle
> 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,

You don't want a table, you want a view:

create view v as
select case when sysdate-trunc(sysdate) between 8/24 and 16/24

         then 'Y' else 'N' end as window_open from dual;

or perhaps a function rather than a view?

--
Posted via http://dbforums.com
Received on Wed Jul 02 2003 - 05:07:14 CDT

Original text of this message

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