Database Zone


View constraints in Oracle 9i

desc user_constraints

Column Name Data Type Null?
OWNER VARCHAR2 (30) N
CONSTRAINT_NAME VARCHAR2 (30) N
CONSTRAINT_TYPE VARCHAR2 (1) Y
TABLE_NAME VARCHAR2 (30) N
SEARCH_CONDITION LONG Y
R_OWNER VARCHAR2 (30) Y
R_CONSTRAINT_NAME VARCHAR2 (30) Y
DELETE_RULE VARCHAR2 (9) Y
STATUS VARCHAR2 (8 ) Y
DEFERRABLE VARCHAR2 (14) Y
DEFERRED VARCHAR2 (9) Y
VALIDATED VARCHAR2 (13) Y
GENERATED VARCHAR2 (14) Y
BAD VARCHAR2 (3) Y
RELY VARCHAR2 (4) Y
LAST_CHANGE DATE Y

select * from user_constraints

Dropping a constraint in Oracle 9i database:

ALTER TABLE [schema].[table_name]
DROP CONSTRAINT [constraint_name];

ALTER TABLE [schema].[table_name] ADD (
CONSTRAINT [constraint_name]
CHECK [constraint_value];

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s