I have inheritied a database from a previous developer, however they did not document the contraints. I can view the contraints using:
and i get the following
Form my understanding R = foreign key, P= primary and I guess C = check. Is there anyway to view the SQL that created the constraints? For example how do I know which table and column a foreign key opints to, or understand what the check constraint actually does?
Code:
select constraint_name, table_name, constraint_type from user_constraints;
and i get the following
Code:
CONSTRAINT_NAME TABLE_NAME C
------------------------------ ------------------------------ -
SYS_C005920 ADMIN C
SYS_C005921 ADMIN P
SYS_C006876 ANNOUNCEMENT C
SYS_C006877 ANNOUNCEMENT C
SYS_C006878 ANNOUNCEMENT C
PK_ANNOUNCEMENT ANNOUNCEMENT P
FK_ANNOUNCEMENT_MODIFIERID ANNOUNCEMENT R
CHECK_CASCADEANNOUNCEMENTS ANNOUNCEMENT C
SYS_C005922 CLASS P
SYS_C005923 DOCUMENT C
SYS_C005924 DOCUMENT C
CONSTRAINT_NAME TABLE_NAME C
------------------------------ ------------------------------ -
SYS_C005925 DOCUMENT C
SYS_C005926 DOCUMENT C
SYS_C005927 DOCUMENT C
SYS_C005928 DOCUMENT C
SYS_C005929 DOCUMENT P
SYS_C006209 DOCUMENT R
SYS_C005930 GROUPS C
SYS_C005931 GROUPS C
SYS_C005932 GROUPS P
SYS_C006868 LINK C
SYS_C006869 LINK C
CONSTRAINT_NAME TABLE_NAME C
------------------------------ ------------------------------ -
SYS_C006871 LINK C
PK_LINK LINK P
FK_LINK_MODIFIER LINK R
FK_LINK_CATEGORY LINK R
CHECK_CASCADELINKS LINK C
PK_LINKCATEGORY LINKCATEGORY P
SYS_C005933 MODIFIER C
SYS_C005934 MODIFIER C
SYS_C005935 MODIFIER C
SYS_C005936 MODIFIER P
FK_MODIFIER_PARENTMODIFIER MODIFIER R
CONSTRAINT_NAME TABLE_NAME C
------------------------------ ------------------------------ -
UQ_MODIFIER_MODIFIER MODIFIER U
SYS_C006900 MODIFIERCLASS C
SYS_C006901 MODIFIERCLASS C
SYS_C006902 MODIFIERCLASS C
PK_MODIFIERCLASS MODIFIERCLASS P
FK_MODIFIERCLASS_MODIFIER MODIFIERCLASS R
FK_MODIFIERCLASS_CLASS MODIFIERCLASS R
Form my understanding R = foreign key, P= primary and I guess C = check. Is there anyway to view the SQL that created the constraints? For example how do I know which table and column a foreign key opints to, or understand what the check constraint actually does?