estou tentando fazer uma consulta hierarquica que me dê os nomes de tabelas que estão ligadas a uma tabela pai por constraints
o select que me da o nome da tabela filho é :
select
filho.table_name -- table_name é a tabela filha
from
sys.all_constraints filho
where
filho.constraint_type = 'R' -- tipo R é fk
and
filho.owner = 'OWNERXX'
and
filhlo.r_constraint_name in
(
select
constraint_name
from
sys.all_constraints pai
where
pai.constraint_type in ('P', 'U') --P é PK
and
pai.table_name = 'NOME_DA_TABELA_RAIZ'
pai.owner = 'OWNERXX'
)
order by
filho.table_name,
filho.constraint_name
eu estou tentando obter SYS_CONNECT_BY_PATH(table_name, '/')
que me daria o path de caminhamento separado por '/'
exemplo tabelaPai/tabelaFilho/tabelaNeto/...
infelizmente não estou conseguindo fazer uma consulta hierarquica funcional....
por favor...
me ajudem hehe