Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2002
    Location
    Virginia
    Posts
    13

    Unanswered: Querying all the constraints in a database

    What would be the proper syntax to return all the constraints in a db.

    Roger
    Roger W. Johnson Jr.


  2. #2
    Join Date
    Jul 2001
    Location
    Germany
    Posts
    189

    Wink If you use Oracle ?!?!?

    Hello,

    if you use Oracle try

    SELECT owner, constraint_name, constraint_type, status, delete_rule
    FROM sys.all_constraints

    Hope that helps ?

    Best regards

    Manfred Peter
    (Alligator Company)
    http://www.alligatorsql.com

  3. #3
    Join Date
    Oct 2002
    Location
    Virginia
    Posts
    13
    Thanks, that worked for all the dbs in my schema, but how would I use that to pertain to one specific db
    Roger W. Johnson Jr.


  4. #4
    Join Date
    Jul 2001
    Location
    Germany
    Posts
    189

    Question

    Hello,

    I don´t know exactly what you mean. If you use this statement you get all constraints in you db independent from your schema.
    The best way to get all constraints is to connect as SYS and start the select.

    Is that not what you are looking for ?

    Manfred Peter
    (Alligator Company)
    http://www.alligatorsql.com

  5. #5
    Join Date
    Oct 2002
    Location
    Virginia
    Posts
    13

    Question

    In my schema I have two db's and I was wondering if it is possible to query just the constraints of just one db
    Roger W. Johnson Jr.


  6. #6
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    Originally posted by rwj7p
    In my schema I have two db's and I was wondering if it is possible to query just the constraints of just one db
    I think maybe you meant to say "In my DB I have two schemas...". The OWNER of a constraint is the SCHEMA that is belongs to. A SCHEMA does not have multiple DBs, a DB can have multiple SCHEMAs.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •