Pages

Showing posts with label Oracle PRIMARY KEY. Show all posts
Showing posts with label Oracle PRIMARY KEY. Show all posts

How to enable or disable Constraints?

Example: Enable/disable primary key StudentsPrimaryKey on students table.

ALTER TABLE students ENABLE  CONSTRAINT StudentsPrimaryKey


ALTER TABLE students DISABLE CONSTRAINT StudentsPrimaryKey

How to add primary key to a table?

Example: Add primary key to students table on ID column.

ALTER TABLE students ADD CONSTRAINT "StudentsPrimaryKe" PRIMARY KEY (ID)