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

Home -> Community -> Mailing Lists -> Oracle-L -> "select ... connect by..." in the view

"select ... connect by..." in the view

From: Igor Neyman <ineyman_at_perceptron.com>
Date: Thu, 26 Feb 2004 11:44:16 -0500
Message-ID: <005001c3fc87$c60e3430$0704a8c0@development.perceptron.com>


Just wonder if anyone has (or came across) better solution for this.  

I had a request from developer to put "select . connect by." into view.

He wants to get the hierarchy in one step, but the "framework" he is using doesn't allow him to issue "select . connect by.".

I've got rather ugly solution for him (which I can share if anyone interested, didn't want this message to be long), using user types, function, and the final view looks like this:  

create or replace view test_view_ms as

SELECT vt.model_id, vt.lvl "LEVEL", vt.parent_subassembly_id, vt.subassembly_id

FROM test_ms tm, TABLE(m_tree(tm.model_id)) vt;  

So, now he can get the hierarchy for specified model with just:

select from test_view_ms where model_id = .  

Igor Neyman, OCP DBA

ineyman_at_perceptron.com    



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--

Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
Received on Thu Feb 26 2004 - 10:48:17 CST

Original text of this message

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