Query table constraint type by querying user_constraints table : user_constraints « System Tables Data Dictionary « Oracle PL/SQL Tutorial

Oracle PL/SQL Tutorial
1. Introduction
2. Query Select
3. Set
4. Insert Update Delete
5. Sequences
6. Table
7. Table Joins
8. View
9. Index
10. SQL Data Types
11. Character String Functions
12. Aggregate Functions
13. Date Timestamp Functions
14. Numerical Math Functions
15. Conversion Functions
16. Analytical Functions
17. Miscellaneous Functions
18. Regular Expressions Functions
19. Statistical Functions
20. Linear Regression Functions
21. PL SQL Data Types
22. PL SQL Statements
23. PL SQL Operators
24. PL SQL Programming
25. Cursor
26. Collections
27. Function Procedure Packages
28. Trigger
29. SQL PLUS Session Environment
30. System Tables Data Dictionary
31. System Packages
32. Object Oriented
33. XML
34. Large Objects
35. Transaction
36. User Privilege
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Oracle PL/SQL Tutorial » System Tables Data Dictionary » user_constraints 
30. 78. 3. Query table constraint type by querying user_constraints table
SQL> select   table_name
  2  ,        constraint_name
  3  ,        case constraint_type
  4                when 'P' then 'PRIKEY'
  5                when 'U' then 'UNIQUE'
  6                when 'C' then ' CHECK'
  7                when 'R' then 'FORKEY'
  8                         else ' OTHER'
  9           end  as type
 10  ,        status
 11  from     user_constraints
 12  order by table_name
 13  ,        type;

TABLE_NAME                     CONSTRAINT_NAME                TYPE   STATUS
------------------------------ ------------------------------ ------ --------
AVAIL_TRACE_FILES              AVAIL_TRACE_FILES_PK           PRIKEY ENABLED
BIN$50P9fUVyS3CVhoJ8p86aww==$0 BIN$VMcdepmcR4ug/22rvF+1xw==$0  CHECK ENABLED
BIN$50P9fUVyS3CVhoJ8p86aww==$0 BIN$CiI/tY7QTzCYPzbRan2qug==$0  CHECK ENABLED
BIN$50P9fUVyS3CVhoJ8p86aww==$0 BIN$5CEHm8aoQI+QEJVhy5P0cQ==$0  CHECK ENABLED
BIN$50P9fUVyS3CVhoJ8p86aww==$0 BIN$Sub47Nl/TUy+yxXOAxEVEQ==$0  CHECK ENABLED
BIN$9NVb8X4RQD++Dre0uN5ukA==$0 BIN$uyol6urWTla+zIWnSplRmg==$0  CHECK ENABLED
BIN$9NVb8X4RQD++Dre0uN5ukA==$0 BIN$I9xRa3jJSBSAauBv1trS8g==$0  CHECK ENABLED
BIN$9NVb8X4RQD++Dre0uN5ukA==$0 BIN$wgvs7nkURFWztU+b57HYPQ==$0  CHECK ENABLED
BIN$9NVb8X4RQD++Dre0uN5ukA==$0 BIN$CtIz0hnsSXqaJPY8sw0+pQ==$0  CHECK ENABLED
BIN$9NVb8X4RQD++Dre0uN5ukA==$0 BIN$E2ZL/AWfSmCZCAacajsefw==$0 UNIQUE ENABLED
BIN$A2IWocWXS/mUCrAdQt9RoQ==$0 BIN$fYL/DxaDSy6P6z8F7l8h/w==$0  CHECK ENABLED
BIN$A2IWocWXS/mUCrAdQt9RoQ==$0 BIN$wyDlgiD/SrSprbYY1MWd1w==$0  CHECK ENABLED
BIN$A2IWocWXS/mUCrAdQt9RoQ==$0 BIN$dqIBTtLSTa+MD7AIx3qdPg==$0  CHECK ENABLED
BIN$A2IWocWXS/mUCrAdQt9RoQ==$0 BIN$NKGL/hLdS12D4ts14Ddtww==$0  CHECK ENABLED
BIN$cVJWgW8YSn6s3cAxBuliGQ==$0 BIN$rsD6uhRWQV6vdE3Z9UV2RA==$0  CHECK ENABLED
BIN$cVJWgW8YSn6s3cAxBuliGQ==$0 BIN$aL7CwqNTQHGbCUdghbAD1Q==$0  CHECK ENABLED
BIN$cVJWgW8YSn6s3cAxBuliGQ==$0 BIN$AfKMoPrLTt+44vfSMnIUGQ==$0  CHECK ENABLED
BIN$cVJWgW8YSn6s3cAxBuliGQ==$0 BIN$823WYDmCQ3iD6DihooQkPw==$0  CHECK ENABLED
BIN$cVJWgW8YSn6s3cAxBuliGQ==$0 BIN$hRwWn2gTQrGr8ley9ne59w==$0 PRIKEY ENABLED
BIN$qf21D14XRemOOpMbQAFcmA==$0 BIN$qv1rrdw5QruTMJ4OO+NEsg==$0  CHECK ENABLED
BIN$qf21D14XRemOOpMbQAFcmA==$0 BIN$Y1rnbAPqQhulusWZAN8UlA==$0  CHECK ENABLED
BIN$qf21D14XRemOOpMbQAFcmA==$0 BIN$T94dKQiqS2SwPcQ+SJCMVA==$0  CHECK ENABLED
BIN$qf21D14XRemOOpMbQAFcmA==$0 BIN$Z6p5I0ZiQAS94s0pILt7Uw==$0  CHECK ENABLED
DDL_AUDIT                      SYS_C004381                     CHECK ENABLED
DDL_AUDIT                      SYS_C004378                     CHECK ENABLED
DDL_AUDIT                      SYS_C004379                     CHECK ENABLED
DDL_AUDIT                      SYS_C004380                     CHECK ENABLED
HAZARD_LEVEL_T                 SYS_C004621                     CHECK ENABLED
HAZARD_LEVEL_T                 SYS_C004617                     CHECK ENABLED
HAZARD_LEVEL_T                 SYS_C004620                     CHECK ENABLED
HAZARD_LEVEL_T                 SYS_C004619                     CHECK ENABLED
HAZARD_LEVEL_T                 SYS_C004618                     CHECK ENABLED
HOME_ADDRESS_LIST              SYS_C004533                    PRIKEY ENABLED
HOME_ADDRESS_LIST              SYS_C004534                    UNIQUE ENABLED
I1                             SYS_C005790                    PRIKEY ENABLED
I2                             SYS_C005791                    PRIKEY ENABLED
MAP                            SYS_C005793                    FORKEY ENABLED
MAP                            SYS_C005794                    FORKEY ENABLED
MAP                            SYS_C005792                    PRIKEY ENABLED
P                              SYS_C006768                    PRIKEY ENABLED
PUBLICATION                    PUBLICATION_PK                 PRIKEY ENABLED
SITE_TAB                       SYS_C004442                     CHECK ENABLED
SITE_TAB                       SYS_C004441                     CHECK ENABLED
WORKING_CUSTOMERS              SYS_C006546                     CHECK ENABLED
WORKING_CUSTOMERS              SYS_C006545                     CHECK ENABLED

45 rows selected.

SQL>
30. 78. user_constraints
30. 78. 1. Getting Information on Constraints
30. 78. 2. Getting Information on View Constraints
30. 78. 3. Query table constraint type by querying user_constraints table
30. 78. 4. Query user_constraints with constraint_type = 'R'
30. 78. 5. Query user_constraints for constraint_type = 'V'
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.