Solved

Where are contraints stored

Posted on 2004-08-12
2
710 Views
Last Modified: 2013-12-11
Hello,
I need to use a commercial tool that creates tables in DB.
When I checked directly in Oracle the table created I could not  see any contraint on it (via DBA console, No PK, no unique). However, if I insert duplicated row, the message is "MYSCHEMA.R36_...."  contraint violated (I cannot remember exactly). I checked views SYS.ALL_CONSTRAINTS and SYS.DBA_CONTRAINTS for the reported name of the constraint, but nothing (I checked all contraints for MYSCHEMA so no mistyped contrain name).
What are other data dictionary views/tables to get constraints?

0
Comment
Question by:matejak
2 Comments
 
LVL 7

Accepted Solution

by:
BobMc earned 125 total points
ID: 11789211
As far as I am aware, there are only two families of dictionary views that hold constraint info

*_CONSTRAINTS          - details about constraints
*_CONS_COLUMNS       - details of columns involved in constraint definitions

However if you create a unqiue index, it wont show up in either, but entering a duplicate value will fail with a ORA-00001: unique constraint (SCHEMA.INDEX) violated

HTH
Bob
0
 
LVL 14

Expert Comment

by:leoahmad
ID: 11789456
select p.table_name PARENT_TABLE, c.table_name CHILD_TABLE
from user_constraints p, user_constraints c
where (p.constraint_type = 'P' OR p.constraint_type = 'U')
and c.constraint_type = 'R'
and p.constraint_name = c.r_constraint_name
/

may be this query helpful in a convinient way.

LeoAhmad
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now