469,362 Members | 2,498 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,362 developers. It's quick & easy.

view constraints on table

2
how to view the constraints on the table like the indexes created etc in sql.Its urgent ..
Dec 4 '08 #1
8 34470
anijos
52
Hi

You can use USER_CONSTRAINTS or ALL_CONSTRAINTS to see all the constraints peresent on a table

Try

Select * from all_constraints
where table_name = 'your_table'

The Constraint_Type column will tell you the type of constraint.


Regards,
AniJos
Dec 4 '08 #2
Pilgrim333
127 100+
Hi,

Most tools like TOAD and PL/SQL Developer make it able for you to see it in the interface under the table.

Pilgrim.
Dec 4 '08 #3
hi you can use user_constraints to find the results from the data dict.


regards
Rahul
Dec 5 '08 #4
bubli
2
hi,i tried using the query "select * from all_constraints....",but could not find any result.Regards,bubli
Dec 5 '08 #5
amitpatel66
2,367 Expert 2GB
For Indixes:

Expand|Select|Wrap|Line Numbers
  1.  
  2. select * from user_indexes WHERE table_name=''
  3.  
  4.  
For Constraints:

Expand|Select|Wrap|Line Numbers
  1.  
  2. select * from user_constraints WHERE table_name=''
  3.  
  4.  
Dec 8 '08 #6
debasisdas
8,127 Expert 4TB
@bubli
try to specify the owner as well with name of the object.
Dec 8 '08 #7
It doesn't work in ORACLE 11g
Feb 10 '17 #8
SQL> select * from all_constraints where table_name='departments';

no rows selected

I tried to view the constraints in the built-in schema @amitpatel66
Feb 10 '17 #9

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by js | last post: by
2 posts views Thread by Sathyaram Sannasi | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.