Oracle - Alter Table, add primary key constraint

September 2, 2010

The primary key its a constraint that specifies that the value of the field fully identifies the row in the table, that is, the value is the “key” to he table. And so this constraint will not permit duplicate or null values int that field.

Its possible to specify more than one field as primary key.

Next, there’s a script for defining a primary key in a already existing table.

alter table add primary key ();