Re: hierarchical trees

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 21 Feb 2003 06:24:49 -0800
Message-ID: <2687bb95.0302210624.1a6fbc44_at_posting.google.com>


cuneyt <member18459_at_dbforums.com> wrote in message news:<2553160.1045747885_at_dbforums.com>...
> Hi all and thanx in advance...
>
> There is a command in Oracle which is "connect by prior" and i think
> it's a function to build "hierarchical trees", so where can I find the
> source of this function, or if anybody knows it please tell me...
>
> What i mean is there would be an SQL function before "connect by prior"
> function written...
>
> Example... I can write a function called called sub
>
> function sub(x,y)
> {
> Z= X - Y
> return z
> }
>
> So and then in my program i can use z=sub(5,3) instead of z=5-3, i think
> connect by prior is same thing but of course longer coding.....
> Where can i get this code?

Cuneyt, I am not sure what you are asking about, but the connect by prior clause is an Oracle extension to SQL:

column ename format a20
select lpad(' ',2 * (level - 1))||ename ename, empno,

       mgr, sal, level, job
from emp
start with empno = (select empno

                    from   emp 
                    where  job = 'PRESIDENT')
connect by mgr = prior empno
/

HTH -- Mark D Powell -- Received on Fri Feb 21 2003 - 15:24:49 CET

Original text of this message