Snippet Name: Primary Key Constraint
Description: A primary key is a single field or combination of fields that uniquely defines a record. None of the fields that are part of the primary key can contain a null value. A table can have only one primary key.
- In Oracle, a primary key can not contain more than 32 columns.
- A primary key can be defined in either a CREATE TABLE statement or an ALTER TABLE statement.
Also see: » Check Constraint: Create
» Unique Constraint
» Foreign Key Constraints
» Current_timestamp
» Deferring Constraint Checking
» Add Primary Key Constraint example
» Constraint Checks
» Add constraint example
Comment: (none)
Language: PL/SQL
Highlight Mode: PLSQL
Last Modified: March 07th, 2009
|
ALTER TABLE OPS$SQLTIME.CT_ADD_NAMES
DROP PRIMARY KEY
/
ALTER TABLE OPS$SQLTIME.CT_ADD_NAMES
ADD CONSTRAINT CT_ADD_NAMES_PK PRIMARY KEY (CT_ID_NO)
USING INDEX
TABLESPACE CTIDX
PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (INITIAL 4096K NEXT 512K MINEXTENTS 1 MAXEXTENTS 100 PCTINCREASE 0 FREELISTS 1)
/ |