Hai everybody,
Can anyone explain how to view all the constraints of a table in Oracle?
-----------
Bhuvana.
Hai everybody,
Can anyone explain how to view all the constraints of a table in Oracle?
-----------
Bhuvana.
SELECT * FROM USER_CONSTRAINTS WHERE TABLE_NAME = ""
Last edited by admin; 11-17-2011 at 04:00 AM.
well, just an addition to above.
kind of obvious but may be helpful for some newbies:-
as the name is string, it is "case SENSITIVE"..
Hi,
use this query
select * from user_constraints
In the database , there are a lot of data dictionary.
one of these dictionary, user_constraints is the dictionary.
can we rename tablespace...?
issue this command:
select * from user_cons_columns;
or select * from all_cons_columns;
or select * from all_constraints;
Last edited by fadamum; 02-13-2009 at 07:38 PM.
SELECT * FROM USER_CONSTRAINTS WHERE TABLE_NAME='EMP';
(This will list you all the constraints from that particular user in which you are logged in.)
WHERE AS you can also use the following statement to view all the constraints for your user as well as for all the other users if that table belongs to them also.
SELECT * FROM ALL_CONSTRAINTS WHERE TABLE_NAME='EMP';
(Note:The table name should be entered in uppercase as Oracle stores them in uppercase by default. or you can use the upper function as upper(emp) if you want to enter it in lower case)
you can also use the statement -- select * from all_constraints where table_name ='EMP'; to view the constraints available from other Owners/Users also.