4D v14

primary_key_definition

Home

 
4D v14
primary_key_definition

primary_key_definition  


 

 

Command primary_key_definitio[CONSTRAINT sql_name] PRIMARY KEY (sql_name, ... , sql_name)

A primary_key_definition is used to pass the column or combination of columns (sql_name) that will serve as the PRIMARY KEY (unique ID) for the table. The column(s) passed must not contain duplicate or NULL values.

An optional CONSTRAINT can also precede the PRIMARY KEY passed in order to limit the values that can be inserted into the column.

Example  

This example creates a table and sets the SID column as the primary key:

CREATE TABLE Customer
(SID int32,
Last_Name varchar(30),
First_Name varchar(30),
PRIMARY KEY (SID));

 
PROPERTIES 

Product: 4D
Theme: Syntax rules

 
SEE ALSO 

ALTER TABLE
foreign_key_definition

 
ARTICLE USAGE

4D SQL Reference ( 4D v11 SQL Release 4 )
4D SQL Reference ( 4D v14)
4D SQL Reference ( 4D v12.1)
4D SQL Reference ( 4D v13.4)
4D SQL Reference ( 4D v14 R2)
4D SQL Reference ( 4D v14 R3)
4D SQL Reference ( 4D v14 R4)