Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: URGENT: Automate an update
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.comReceived on Wed Jul 02 2003 - 05:07:14 CDT
![]() |
![]() |