Topic: SQL*Plus and PL/SQL >> constraint
|
Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property.
You may review the entire Oracle Certification Program Candidate Agreement online Here.
|
|
|
|
| sathish |
Posted: Jan 17, 2007 01:50:28 AM |
Total Post: 47
Joined: Mar, 2006
|
I want to see all my primarykey ,unique columns ...etc
ex:
column_name constraint_name table_name key_type
emp_id sys_c003090 emp primarykey
email sys_c001238 not null
dob sys_c788000 unique
etc...
|
|
|
Jayanta |
| Posted: Jan 17, 2007 10:59:21 AM | |
|
Total Post: 479
Joined: Feb, 2006
|
query user_cons_columns, user_constraints
hope this will work
with regards
jayanta
|
|
|
|
|
maddy |
| Posted: Jan 26, 2007 01:49:34 AM | |
|
Total Post: 18
Joined: Aug, 2006
|
Dear satish,
Query the USER_CONSTRAINTS table to view all constraint definitions and names,
SELECT CONSTRAINT_NAME,CONSTRAINT_TYPE,SEARCH_CONDITION
FROM USER_CONSTRAINTS
WHERE TABLE_NAME='EMPLOYEES';
View the columns associated with the constraint names in the USER_CONS_COLUMNS view .
SELECT CONSTRAINT_NAME,COLUMN_NAME
FROM USER_CONS_COLUMS
WHERE TABLE_NAME='EMPLOYEES';
Hope this helps you,
regards,
maddy.
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |
|
|
|
|
Forum Rules & Description
Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user
|
| |
Get FREE Magazines
|
Top 10 Forum User
|
| Murtuja Khokhar | 857 |
| Mohammed Taj | 746 |
| positive fanatic | 483 |
| Jayanta Sur | 479 |
| Vigyan Kaushik | 386 |
| Gopu Gopi | 335 |
| Gitesh Trivedi | 322 |
| Vinoth Kumar | 264 |
| neeraj sharma | 258 |
| Ramesh Jois | 246 |
|
|