Re: SOLVED: Emulating 'connect by prior' using stored proc

From: "Merrall, Graeme" <gmerrall(at)team(dot)aol7(dot)com(dot)au>
To: "Randolf Richardson, DevNet SysOp 29" <rr(at)8x(dot)ca>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: SOLVED: Emulating 'connect by prior' using stored proc
Date: 2003-11-19 04:24:25
Message-ID: B7AD8B4B4A337741B62E633B4827ADD932D5CD@svrexc02.aolau.ops.au.office.aol.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> I have one question because I'm not clear about
> something with your
> implementation (a good one too by the looks of it -- thanks
> for sharing
> this information); if I start my query from an item at level
> 5, will the
> level be reflected as such, or will it dynamically start at 1?
>
> As I understand it, in Oracle the level would begin at
> 1 in this case.
>

It's the same in this case. The tree building stuff only ever looks down
so the level returned in the query results will start at 1 no matter
where you enter your tree. In our case we could enter the tree at
'node' 100 and get the tree below that but the function will start at 1
because we only interested in the data below not the entry point and not
where in the tree we entered.

As in the solution if you really want to start it at 5 then set that as
the value of your second parameter.

Cheers,
Graeme

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Greg Stark 2003-11-19 06:29:20 Re: Expressional Indexes
Previous Message Abdul Wahab Dahalan 2003-11-19 01:26:02 Need Help : Query problem