On 14 Jun 2005, at 17:52, [EMAIL PROTECTED] wrote:

My suggestion, lame as it is, would be to use a 0 (zero) in place of the NULL value. That way, you always have a valid entry for PARENT_ID, you can
still identify the tops of the trees (parent_id=0) and you have gotten
around the only-one-parent-entry-can-be-null trap.

Because of the cascade deletion setting, it will not allow inserts of any record where a record with the parent ID does not exist because the new child record will be deleted immediately in order to satisfy the constraint. As far as I'm aware this is exactly the kind of thing that null vales are for - for example a constraint where the action is set_null instead of cascade would quite correctly set the parent_id to null, leaving an unowned child. What I need is a cascade on delete that allows null values (on the basis that null != null because neither is a value). Am I just fantasizing?

Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
[EMAIL PROTECTED] | http://www.synchromedia.co.uk


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to