[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Recursive SQL



Dr Rao,

I dont remember having seen "Connect by" in Oracle when I took database. So
it seems in trying to make Oracle more of an Object-Oriented Database this
new construct has come in.

So does it mean that Object-Relational (which is what the new Oracle Db is)
would be a better model to work with than pure Relational.

Ullas

-----Original Message-----
From: Subbarao Kambhampati <rao@asu.edu>
To: soapman@IMAP4.ASU.EDU <soapman@IMAP4.ASU.EDU>
Cc: cse494-s01@parichaalak.eas.asu.edu <cse494-s01@parichaalak.eas.asu.edu>
Date: Monday, April 16, 2001 5:51 PM
Subject: Re: Recursive SQL


>Actually, what I said was that recursion is not allowed by the relational
>database model--whose *semantics* are given by relational algebra and
>relational calculus. SQL is not exactly relational database--it supports a
>bunch of things outside of it--including order-by clauses and some limited
>form of transitive closures.  (I believe I mentioned this...) You cannot
>give relational algebra semantics to either the order-by clauses (since
>tuples ahve no order) or the recursive queries (since the corresponding
>query tree will be non-acyclic).
>
>Rao
>
>
>At 05:35 PM 4/16/2001 -0700, you wrote:
>
>>In earlier database lectures. You made a very strong point that SQL could
not
>>handle recursion and is thus a main weakness. Just a few days ago,
however, I
>>found myself performing recursion with SQL in an Oracle database. This is
>>done by the CONNECT BY clause.
>>
>>To get all descendents of 'Bret' based on a parents table
>>parents(name,parent):
>>
>>select name
>>from parents
>>connect by prior name = parent
>>start with name = 'Bret'
>>
>>This type of sql seems like an interesting fix to the recursion problem.
I'm
>>curious if you have considered it.
>>
>>Thanks,
>>Bret
>
>
>