Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: any sql statement to list child tables?
Thenardier_at_POBoxes.com wrote:
>is there any sql statement which can list all the child tables and
>their keys and foriegn keys? ... cos i'm tired of consulting the
>3-inch technical references anymore! :P
Hi,
try this query:
SELECT uc.table name master table, uc.constraint name master key, uc.constraint type master key type, uc2.table name detail table, uc2.constraint name foreign key FROM user constraints uc2, user constraints uc WHERE uc.table name = UPPER('&Master table')AND uc.constraint type IN ('P', 'U')
HTH,
Peter
-- Peter Schneider peter.schneider_at_okay.netReceived on Mon Sep 14 1998 - 00:00:00 CDT
![]() |
![]() |