Solved

Where are contraints stored

Posted on 2004-08-12
2
716 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Problem with duplicate records in Oracle query 16 52
oracle collections 2 29
Help with Oracle IF statment 5 37
PL/SQL: ORA-00979: not a GROUP BY expression 3 56
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

697 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