Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Imposing Functional Dependencies
"Yash" <yash_ganthe_at_hotmail.com> wrote in message news:<a3sth0$noe$1_at_news.vsnl.net.in>...
> Hi,
> I have a table myTable(A,B,C,D). I know that for a given C value, the
> value of D is fixed. Thus C functionally determines D. I don't want to
> normalise the table. I only want to enforce this constraint so that nobody
> inserts rows that have different values for the same value of C. How do I
> set the constarint? I am looking for the Oracle DDL statement in particular.
>
> Thanks.
Hi Yash,
i think, there's no way to define such a constraint declarative with ddl. You should use trigger instead, which automatically fill the d value.
create or replace trigger <name>
before insert or update on <table>
for each row
begin
select <column wich determines d) into :new.d from <where ever>
where <one row condition>;
end;
Best regards,
Andreas
Received on Thu Feb 07 2002 - 01:10:18 CST