Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Connect By Woes

Re: Connect By Woes

From: Howard Lee Harkness <hlh_nospam_at_excite.com>
Date: Tue, 20 Jul 1999 15:40:41 GMT
Message-ID: <3DE1620F55F92721.911EA3E0C2E61B80.9988ACB3DEFF012E@lp.airnews.net>


On Sat, 17 Jul 1999 04:55:23 GMT, Martin Douglas <Martin.Douglas_at_Boeing.com> wrote:

>Does anyone know if Oracle 8.1.5 has extended CONNECT BY to something
>like...
>
> CONNECT BY (PARENT_ID = PRIOR SELF_ID, PREVIOUS_ID = PRIOR SELF, ...)
I had to do something similar, and found the CONNECT BY too limiting (for one thing, I have an elaborate set of criteria to decide which sub-assemblies needed to be exploded.). I ended up coding a recursive procedure to do what I wanted. As near as I could tell, that worked as quickly as the CONNECT BY, and gave me much better control of the process.

Here is an abridged code fragment that might give you some ideas. Since I am a relatively inexperienced PL/SQL coder, it is likely that someone here make be able to suggest improvements on this. These recursive procedures are from a package which builds several intermediate tables for the purpose of specilized reporting.

/* ================================================================
	Populate Tree for given top assembly
   ================================================================ */
PROCEDURE tree(
               user_id IN VARCHAR2,
               user_contract IN VARCHAR2,
               topassembly IN VARCHAR2,
               effective_date IN DATE,
               production_or_documentation IN VARCHAR2
               ) 

IS
--
top_qty_rec top_qty_cur%ROWTYPE;
sort_index NUMBER :=1;
-- a table to keep track of the current multiplier multiplier_table level_type;
--
BEGIN
   setEffectiveDate(effective_date);

hlh_NOSPAM_at_excite.com is a valid, unmunged address! It is also so full of spam(!) that I don't read it. Received on Tue Jul 20 1999 - 10:40:41 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US