If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Querying all the constraints in a database

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-25-02, 20:15
rwj7p rwj7p is offline
Registered User
 
Join Date: Oct 2002
Location: Virginia
Posts: 13
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.

Reply With Quote
  #2 (permalink)  
Old 11-25-02, 20:26
alligatorsql.com alligatorsql.com is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 11-25-02, 20:33
rwj7p rwj7p is offline
Registered User
 
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.

Reply With Quote
  #4 (permalink)  
Old 11-26-02, 04:05
alligatorsql.com alligatorsql.com is offline
Registered User
 
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
Reply With Quote
  #5 (permalink)  
Old 11-26-02, 09:58
rwj7p rwj7p is offline
Registered User
 
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.

Reply With Quote
  #6 (permalink)  
Old 11-26-02, 10:08
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
Quote:
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.
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On