Re: Nearest Common Ancestor Report (XDb1's $1000 Challenge)

From: Hugo Kornelis <hugo_at_pe_NO_rFact.in_SPAM_fo>
Date: Sat, 22 May 2004 00:03:09 +0200
Message-ID: <4husa0pubg2len122cvcohip05n4ta2dn3_at_4ax.com>


On 20 May 2004 15:07:05 -0700, Neo wrote:

Hi Neo,

>> > Changing any one of them would corrupt the data.
>>
>> No. Changing any of them would result in a foreign key violation and the
>> transaction would be rolled back by SQL Server. You didn't miss the
>> "references" clauses in my DDL, did you?
>
>You are correct. I could not change the name of any thing in the first
>two columns of table hierarchies so I could not corrupt the data this
>way; however, this design prevents two things from having the same
>name, thus it is a non-generic solution.

Already addressed elsewhere.

>I did manage to corrupt the data by changing one of the duplicate
>'leader' to 'leader2' in the third column. You missed it here. In
>XDb1, the relator 'leader' is normalized.

Hold on a minute, Neo. Please check what you posted in the message that started this discussion:

"(...) and the solution must be as generic, meaning allow the user to create ANY hierarchy, (...)"

My first attempt at your challenge didn't have a table hierarchies, it had a table leadership (or something like that), with two columns leader and follower. But when I reread your psot to check if I fulfilled all requirements, I saw that you wanted a GENERIC solution, that would allow ANY hierarchy. That's why I renamed the table "hierarchies", added the hierarchy column and added a parameter to the procedure.

Now, I just tested what would happen if I tried to do the same kind of thing with the XDb1 solution. I entered "laptop1 leader2 trinity." and got the following error message: "Invalid relator."

Hmmmmm. I thought the requirement was to "allow the user to create ANY hierarchy" ????

        http://dictionary.reference.com/search?q=any

Best, Hugo

-- 

(Remove _NO_ and _SPAM_ to get my e-mail address)
Received on Sat May 22 2004 - 00:03:09 CEST

Original text of this message