Re: Referential integrity

From: J.P. <jp_boileau_at_yahoo.com>
Date: 23 May 2002 12:19:03 -0700
Message-ID: <7e388bc3.0205231119.5491fe1d_at_posting.google.com>


Not exactly rocket science on this one...

DELETE FROM A2
WHERE ID = (SELECT ID FROM A1 WHERE FILENAME = mysearchkey)

JP

sai_surya_mp_at_yahoo.com (surya) wrote in message news:<e4fde6e1.0205230252.2d1efa37_at_posting.google.com>...
> I am having tow tables
>
> CREATE TABLE A1(
> Id CHAR(4),
> FileName CHAR(X),
> primary key(Id)
> )
>
> CREATE TABLE A2(
> Id CHAR(4) ,
> FileName VARCHAR(250),
> primary key(Id)
> )
>
> Whenever i update Table A1 column "FileName" with X the same record,
> with same Id,in Table A2 automatically need to be deleted. I need to
> maintain Referential integrity between both tables.
>
> Can you please suggest a Modified table quries for the above
>
> Thanks in advance
Received on Thu May 23 2002 - 21:19:03 CEST

Original text of this message