Wednesday, October 10, 2007

To get constraint details - oracle SQL

We cannot display all the constaint details in the DB code, so most of the time it just provides constaint name. Need to get the actual details from the database. It would look somthing like below, owner is the schema owner name.

select * from all_cons_columns where owner = 'DEVDBA'
and constraint_name = 'VALID_YES_NO481';


If needed we can get all the constraint applied to the table by executing below query

SELECT * FROM ALL_CONSTRAINTS WHERE TABLE_NAME='SALES' and owner = 'DEVDBA'

2 comments:

Anonymous said...

Thank you !

Anonymous said...

You've made some really good points there. I checked on the web for more info about the issue and found most individuals will go along with your views on this web site.

Check out my website - easy diets that work