Re: onDelete cascade after table has been created

From: <apoorv.kanungo_at_gmail.com>
Date: Sat, 20 Feb 2016 01:40:35 -0800 (PST)
Message-ID: <d36c9c98-2126-42f9-8e29-04bd53e000da_at_googlegroups.com>


On Saturday, February 20, 2016 at 2:27:09 PM UTC+5:30, J.O. Aho wrote:
> On 02/20/2016 07:10 AM, apoorv.kanungo_at_gmail.com wrote:
> > Hello I know we can use cascading while creating table but After I created table and there are bunch of data in it how would I do ondelete cascade.
>
> You have specified that delete rows when the user is deleted
>
> delete from user where id = 12
>
>
> will delete the rows in article too. No extra queries to execute or
> other commands, you have already defined the behaviour when you created
> the tables, without the on delete cascade, you wouldn't be able to
> delete the user until you had deleted the articles first.
>
>
> --
>
> //Aho

Hi there I did not provide on delete Cascade when I create table but after table has been created if i delete delete from user where id=4 and I would like to delete entry in article table with user_id=4 but its not the case as it does not get deleted from article table. Received on Sat Feb 20 2016 - 10:40:35 CET

Original text of this message