| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: Constraints
Scott Staub wrote:
> Using the constraint name, how can I determine the table name and field name
> that the constraint is for?
>
> Thank you in advance,
>
> Scott
SELECT table_name
FROM all_constraints
WHERE constraint_name = '<constraint_name>';
To trace parent-child relationship:
SELECT T.owner AS CHILD_OWNER,
T.table_name AS CHILD_TABLE,
T.constraint_name AS FOREIGN_KEY_NAME,
R.owner AS PARENT_OWNER,
R.table_name AS PARENT_TABLE,
R.constraint_name AS PARENT_CONSTRAINT
FROM dba_constraints T, dba_constraints R
WHERE T.r_constraint_name = R.constraint_name AND T.r_owner = R.owner AND T.constraint_type='R'
Daniel Morgan Received on Tue Mar 11 2003 - 10:55:08 CST
![]() |
![]() |