×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Data Dictionary Table/View of Constraints?

Data Dictionary Table/View of Constraints?

Data Dictionary Table/View of Constraints?

(OP)
Is there a Data Dictionary Table or View where I can get constraint definitions.  What I am looking for is a way to find all constraint names, types (Primary, Unique, Foriegn, Check) and also if it is foriegn what are the referenced schema.table and if it is check what is the check.  

Also on a related note, Is there a good reference available of the Data Dictionary tables/view.  The Oracle Press books that I have (Oracle 8 PL/SQL Programming and Oracle 8i DBA Handbook) both touch on them but neither gets into too much detail.

TIA,

tone

RE: Data Dictionary Table/View of Constraints?

You are looking for the DBA_CONSTRAINTS and DBA_CONS_COLUMNS views.  DBA_CONSTRAINTS will give you the basic information you listed.  DBA_CONS_COLUMNS will give you information such as which column(s) the constraint is defined on.

I find the Server Administrator's Guide and Server Reference Manuals that come with the server to be the best sources of information like this.

RE: Data Dictionary Table/View of Constraints?

(OP)
carp,

I found those to views but they still don't tell me the referenced columns in a foreign key or the value of the check constraint.  I also found a view called DICTIONARY while I was searching.  This view gives that name of the views in the data dictionary with a description.  Then there is DICT_COLUMNS which gives descriptions of all the columns in all the data dictionary views in DICTIONARY.

tone

RE: Data Dictionary Table/View of Constraints?

Sure they do!  In DBA_CONSTRAINTS, the r_constraint_name tells you which Primary Key or Unique constraint your FK constraint references.  Likewise, search_condition will tell you what your check constraint is checking.

RE: Data Dictionary Table/View of Constraints?

(OP)
carp,

THANK YOU!  That was what I needed.  I couldn't see what r_constraint_name was all about until your last post.  

tone

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close