List:MaxDB« Previous MessageNext Message »
From:Dejan Paunovic Date:October 7 2004 11:26am
Subject:problem with (self-referential) on delete cascade
View as plain text  
Hello, everyone.
I'm using MaxDB (brand new version) on Windows XP.
I have two tables that represent nodes and leaves in a tree (NODE and LEAF). 
Table NODE has a foreign key (parent_id) that references the primary key 
(id) of the same table and table LEAF has a foreign key
(parent_id) that references the primary key (id) in the table NODE.
Both foreign keys have ON DELETE CASCADE rules (so that when a node is 
deleted all of its children are also deleted).

If I have this kind of situation:

1)             node1 <-- node2

and try to delete node1 I get this error:
"General error;-8 POS(1) Execution failed, parse again".

But if I have situation like this:

2)             node1 <-- node2 <-- leaf1

and try to delete node1, it works fine.

This is happening when I'm deleting from SQL Studio and also from my java 
program (using jdbc).

Can someone, please, tell me why the first delete can't be executed?

Thanks.
Dejan

Thread
problem with (self-referential) on delete cascadeDejan Paunovic7 Oct