RE: [sqlite] Are DELETE TRIGGERS recursive or not?

2005-10-29 Thread Ralf Junker
Hello Allan, Mark,

I am not sure, but I don't think recursive delete triggers apply to your 
web-page example.

I was looking for recursive delete triggers because the information I need to 
store in a single table is hierarchical in a sense that a record can refer to 
another record in the same table (like when storing a tree structure). With 
recursive delete triggers, a single delete would automatically delete all 
children AND GRANDCHILDREN of that tree's node. Deleting children with triggers 
is possible without recursion, but you need recursive delete triggers to delete 
the grandchildren also.

I don't know if recursive delete triggers will improve performance, but they 
will certainly make it easier to maintain referential integrity for 
hierarchical, tree-like data.

Regards,

Ralf

>Have you had a look at the following web-page:-
>
>http://www.justatheory.com/computers/databases/sqlite
>
>This is a way of enforcing referential integrity in SQlite with triggers 
>although evidently not with recursive triggers.
>We have implemented this in our system. Would you mind explaining to me the 
>benefit of recursive triggers for this purpose? I ask as we are trying hard to 
>optimise the performance of our deletes, do you think using recursive triggers 
>(when implemented) will be more efficient at cascading deletes?



Re: [sqlite] Are DELETE TRIGGERS recursive or not?

2005-10-27 Thread Ralf Junker
Hello [EMAIL PROTECTED],

Thank you! I am very much looking forward to recursive delete triggers for just 
the very purpose you mentioned!

Regards,

Ralf

>Not at this time.  Though work is underway to change this.
>We need recusive delete triggers in order to implement
>cascadinig deletes for referential integrity.



Re: [sqlite] Are DELETE TRIGGERS recursive or not?

2005-10-25 Thread drh
Ralf Junker <[EMAIL PROTECTED]> wrote:
> I wonder if a DELETE TRIGGER should trigger itself recursively 

Not at this time.  Though work is underway to change this.
We need recusive delete triggers in order to implement
cascadinig deletes for referential integrity.
--
D. Richard Hipp <[EMAIL PROTECTED]>



Re: [sqlite] Are DELETE TRIGGERS recursive or not?

2005-10-25 Thread Kurt Welgehausen
If the trigger were recursive, it would invoke
itself forever, even if it's not doing anything
because the where clause fails.

Regards