Constraints [message #431374] |
Tue, 17 November 2009 03:40  |
GuestUser32
Messages: 26 Registered: August 2009
|
Junior Member |
|
|
Hi
Is it possible to run a query to see all constraints in a database?
I ask because I have a script which is creating a table but it says 'name already used by an existing constraint'.
Thanks
|
|
|
|
|
Re: Constraints [message #431384 is a reply to message #431374] |
Tue, 17 November 2009 03:49   |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
YOu just need to look at the constraints in your schema - constraint names are unique in a schema, not in a database.
Look at the USER_CONSTRAINTS view.
|
|
|
Re: Constraints [message #431386 is a reply to message #431374] |
Tue, 17 November 2009 03:52   |
GuestUser32
Messages: 26 Registered: August 2009
|
Junior Member |
|
|
Thanks for the answer
By the way I didnt repeat my question!!
There is a fault with the website as I said previously. I only created one topic and put one reply to a topic.
Sorry for the multiple replies and topics!!
|
|
|
Re: Constraints [message #431387 is a reply to message #431374] |
Tue, 17 November 2009 03:53   |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
Please - if it looks like your browsers hung, please check to see if the post happened before reposting!!!!
|
|
|
|
Re: Constraints [message #431391 is a reply to message #431374] |
Tue, 17 November 2009 03:59   |
GuestUser32
Messages: 26 Registered: August 2009
|
Junior Member |
|
|
Well what I meant was I created one topic and the page hung, so I refreshed the page and the body reset back to blank aswell as the title so I just created a whole new topic again unaware that the other one had actually been created.
At the end of the day its not my fault!! This should be looked into as it will happen again to someone else.
|
|
|
|
|
|
Re: Constraints [message #431411 is a reply to message #431391] |
Tue, 17 November 2009 04:50   |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
Quote:At the end of the day its not my fault!! This should be looked into as it will happen again to someone else.
At the end of the day, you're the person who submitted the same question 6 times without checking that anything had been posted.
All we're asking is that you don't do it again.
That's it - nothing else.
|
|
|
Re: Constraints [message #431415 is a reply to message #431411] |
Tue, 17 November 2009 04:57   |
GuestUser32
Messages: 26 Registered: August 2009
|
Junior Member |
|
|
Quote:At the end of the day, you're the person who submitted the same question 6 times without checking that anything had been posted.
hang on there me ol fruit!!
At the end of the day (i.e. who the blame should be pointed at) is the system not the fact that I reposted. I am sligtly to blame but the main focus should be on the system.
Anyway enough of this silly arguement.
|
|
|
Re: Constraints [message #431467 is a reply to message #431374] |
Tue, 17 November 2009 08:16   |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
Just to get back on track...Object names must be unique in a schema. Table names cannot have the same name as an index, constraint, procedure, etc. and vice versa.
|
|
|
Re: Constraints [message #431472 is a reply to message #431415] |
Tue, 17 November 2009 09:04   |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
Quote:I am sligtly to blame but the main focus should be on the system.
<Pffft> A transparent attempt to avoid the heinous penalties for culpability in this matter.
I can't fix the server that hosts this board, but I can prod you with a (metaphorical) pointy stick.
Anyway - USER_CONSTRAINTS will show you everything in your schema, ALL_CONSTRAINTS will show you the constraints on all the objects in the database that you have privileges on, and DBA_CONSTRAINTS will (if you have the privileges required to see it) show you all the constraints in the DB.
Similarly named views exist for _TABLES, _INDEXES, _VIEWS, _OBJECTS, and many, many more.
Details on them can be found Here
|
|
|
|
|
|
|