ON_DELETE_CASCADE constraint is not working

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ON_DELETE_CASCADE constraint is not working

ajay-7
Hello there,

I have two tables and used constraint ON_DELETE_CASCADE in one of the table
to delete records from second table if records from first table are deleted
which foreign key points to first table. I'm using SQLiteExplorer to
manipulate tables. But it is not working properly. I found all records of
first table as it is though record of foreign key is deleted from second
table.

Let me know solution.

 

Regards,

Ajay Sonawane

Reply | Threaded
Open this post in threaded view
|

Re: ON_DELETE_CASCADE constraint is not working

Dan Kennedy


--- Ajay <[hidden email]> wrote:

> Hello there,
>
> I have two tables and used constraint ON_DELETE_CASCADE in one of the table
> to delete records from second table if records from first table are deleted
> which foreign key points to first table. I'm using SQLiteExplorer to
> manipulate tables. But it is not working properly. I found all records of
> first table as it is though record of foreign key is deleted from second
> table.
>
> Let me know solution.

Unfortunately, foreign keys are not supported yet. You can add triggers
to achieve the same functionality, although it is not as conveniant.

http://www.sqlite.org/omitted.html

>  
>
> Regards,
>
> Ajay Sonawane
>
>



               
__________________________________
Discover Yahoo!
Stay in touch with email, IM, photo sharing and more. Check it out!
http://discover.yahoo.com/stayintouch.html
Reply | Threaded
Open this post in threaded view
|

RE: ON_DELETE_CASCADE constraint is not working

ajay-7

Hello there,
Will you please tell me when SQLite will be supporting FOREIGN KEYS and
ON_DELETE_CASCADE? Where can I get more information about version and what's
new feature?
As well as Can someone guide me about how to write and fire trigger that
could do work of "ON_DELETE_CASCADE"

Regards,
Ajay Sonawane




> Hello there,
>
> I have two tables and used constraint ON_DELETE_CASCADE in one of the
table
> to delete records from second table if records from first table are
deleted
> which foreign key points to first table. I'm using SQLiteExplorer to
> manipulate tables. But it is not working properly. I found all records of
> first table as it is though record of foreign key is deleted from second
> table.
>
> Let me know solution.

Unfortunately, foreign keys are not supported yet. You can add triggers
to achieve the same functionality, although it is not as conveniant.

http://www.sqlite.org/omitted.html

>  





               
__________________________________
Discover Yahoo!
Stay in touch with email, IM, photo sharing and more. Check it out!
http://discover.yahoo.com/stayintouch.html