Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Binary Tree Implementation
"No Such Luck" <no_suchluck_at_hotmail.com> a écrit dans le message de news: 1134081031.025411.73590_at_f14g2000cwb.googlegroups.com...
| I'm new to Oracle (10G), and I'm trying to create a binary tree
| structure with a self-referencing table, but I am having some trouble.
|
| Table NODE
| NODEID (PK)
| PARENTNODEID (FK)
| LEFTCHILDNODEID (FK)
| RIGHTCHILDNODEID (FK)
| DATA
|
| The FK constrained fields have two purposes:
| - They can be initially NULL, but when a node ID is later entered, it
| must be a valid NODEID for an existing entry.
| - Cascade deletes: If a parent node is deleted, all children (and
| their children) must be deleted as well.
|
| When I try to apply an FK constraint on any of the parent or child id
| columns, I receive a deadlock time out.
|
| Can any point me in the direction of my error, or perhaps suggest a
| better or different way of doing this?
|
| Thanks in advance.
|
Can you post a test case.
Regards
Michel Cadot
Received on Sat Dec 10 2005 - 01:25:53 CST
![]() |
![]() |