Solved

Where are contraints stored

Posted on 2004-08-12
2
719 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
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 setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

717 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