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

Home -> Community -> Usenet -> c.d.o.tools -> Re: trigger question

Re: trigger question

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: 2000/08/02
Message-ID: <965242751.28509.0.pluto.d4ee154e@news.demon.nl>#1/1

No, the syntax I provided you with is correct. Either trust me or read the manual, and you will see I am correct.
Also AFAIK a column can not act as a primary key and a foreign key at the same time, or you have a case of bad table design. If there is a truly 1-on-1 relationship between table1 and table2, one of the two tables shouldn't have existed at all.

Hth,

Sybrand Bakker, Oracle DBA

"luio" <lctNOlcSPAM_at_hotmail.com.invalid> wrote in message news:1cc42a50.73022d87_at_usw-ex0104-028.remarq.com...
> alter table table2 add constraint <whatever name> foreign key
> (id) references table1 *on delete cascade*
> (provided table1.sid is the primary key of that table)
>
> there is on exception. how about the table2.id is the primary
> key of table2. but sid the primary key of table?
> then
> I use
> alter table table1 add constraint <whatever name> foreign key
> (id) references table2 *on delete cascade*
> to implement the delete on table 2 whenever I delete sth from
> table1?
>
>
>
> thanks
>
>
>
>
> The solution I posted previously should also work, but it is
> more cumbersome.
>
> Hth,
>
>
>
>
> -----------------------------------------------------------
>
> Got questions? Get answers over the phone at Keen.com.
> Up to 100 minutes free!
> http://www.keen.com
>
Received on Wed Aug 02 2000 - 00:00:00 CDT

Original text of this message

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