dbTalk Databases Forums  

For Billy Verreynne

comp.databases.oracle comp.databases.oracle


Discuss For Billy Verreynne in the comp.databases.oracle forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Alex Kizub
 
Posts: n/a

Default For Billy Verreynne - 08-27-2004 , 11:58 AM






Billy:
I like your answers in the groups.
Especially something like this:

Damn, don't you just love SQL! :-)
I have yet to find a query that can not be done in
SQL..

I feel that I'm wrong but here is task which I can't
solve in sql.
Can you?

Problem is I can't use PL/SQL for two reasons:
1) I work trough JDBC
2) Our DBA do not give me permission to use any
procedure.

Actually I have third reason - this is not our
database, we can read only and
it is so big and impractical... It looks for me that
they don't know anything
about relations and just use tables as flat files ((

Anyway, here is question.
We have table which holds tree structure in such way:

View 1
Owner Item Sequence Level
a a1 1 1
a a2 2 2
a a3 3 3
a a4 4 1
a a5 5 2
b b1 1 1
b b2 2 1
b b3 3 2
b b4 4 3

I need SQL which produces each item with its path.
Like this

View 2
Owner Item Level1 Level2 Level3
a a1 a1
a a2 a1 a2
a a3 a1 a2 a3
a a4 a4
a a4 a4 a5
b b1 b1
b b2 b2
b b3 b2 b3
b b4 b2 b3 b4

Problem is that this table is huge, has many owners
and each of them
has own sequence.

Of course I can do it in the application. Even they do
it in this way.
They have special process (which they run every week
which
translates table with View 1 to additioanal table with
View 2.
Of course such "syncronization" only makes whole
system worse ((

Any idea how I can use SQL only to handle this?

Thanks in advance,
Alex Kizub.

P.S. Your e-mail address is not good.
I got this:
This Message was undeliverable due to the following reason:

The following destination addresses were unknown (please check
the addresses and re-mail the message):

SMTP <vslabs (AT) onwe (DOT) co.za>

Please reply to <postmaster (AT) tiscali (DOT) co.za>
if you feel this message to be in error.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.