Java Mailing List Archive

http://www.dba.5341.com/

Home » Home (12/2007) » oracle l »

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

Igor Neyman

2004-02-26

Replies:

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@perceptron.com

 

 

©2008 dba.5341.com - Jax Systems, LLC, U.S.A.