Results 1 to 9 of 9

Thread: How to view constraints?

  1. #1
    Junior Member
    Join Date
    Jan 2007
    Answers
    8

    How to view constraints?

    Hai everybody,

    Can anyone explain how to view all the constraints of a table in Oracle?

    -----------
    Bhuvana.


  2. #2
    Junior Member
    Join Date
    Mar 2006
    Answers
    1

    Re: How to view constraints?

    SELECT * FROM USER_CONSTRAINTS WHERE TABLE_NAME = ""

    Last edited by admin; 11-17-2011 at 04:00 AM.

  3. #3
    Junior Member
    Join Date
    Dec 2008
    Answers
    1

    Re: How to view constraints?

    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"..


  4. #4
    Junior Member
    Join Date
    Dec 2008
    Answers
    1

    Re: How to view constraints?

    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.


  5. #5
    Junior Member
    Join Date
    Dec 2008
    Answers
    2

    Re: How to view constraints?

    can we rename tablespace...?


  6. #6
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    Re: How to view constraints?

    Quote Originally Posted by deep chandan View Post
    can we rename tablespace...?

    Please do not hijack others threads.
    Please start a new fresh thread for your own questions.


  7. #7
    Junior Member
    Join Date
    Feb 2009
    Answers
    1

    Re: How to view constraints?

    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.

  8. #8
    Junior Member
    Join Date
    Nov 2009
    Answers
    2

    Re: How to view constraints?

    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)


  9. #9
    Junior Member
    Join Date
    Nov 2009
    Answers
    2

    Re: How to view constraints?

    you can also use the statement -- select * from all_constraints where table_name ='EMP'; to view the constraints available from other Owners/Users also.


  10.  Sponsored Ads
    Ad


     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact