Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Does anyone have a script to display hierarchy of tables starting with a specific one
Hi !
Try something like this :
create table my_table as
select
OWNER ,
CONSTRAINT_NAME , CONSTRAINT_TYPE , TABLE_NAME ,
SELECT Substr (lpad ('*', level, '-')|| table_name, 1, 30)
FROM my_table
WHERE constraint_type != 'C'
START WITH table_name = ...
-- AND CONSTRAINT_TYPE = 'R'
CONNECT BY PRIOR CONSTRAINT_NAME = R_CONSTRAINT_NAME
/
A+
Eric <ebektech_at_videotron.ca> a écrit dans le message :
n3dA4.41$585.157570_at_news.magma.ca...
> based on the fk-pk relationship...
>
> example:
> employee
> dept
> store
> marital_status
> address
> country
> .
> .
> .
>
>
>
Received on Thu Apr 13 2000 - 00:00:00 CDT
![]() |
![]() |