Using CREATE TABLE. . . How can you specify that no duplicates are allowed on a specific field?
_
Printable View
Using CREATE TABLE. . . How can you specify that no duplicates are allowed on a specific field?
_
apply a unique constraint. Here's some example constraints ...
Now, go and read the SQL Reference, and the Concepts Guide, on the subject of constraints.Code:create table
my_table
(
col1 number primary key,
col2 number unique,
col3 references my_parent_table
);
create table
my_table
(
col1 number
constraint
xpkmy_table
using index
tablespace my_ts
pctfree 0 nologging,
col2 number
constraint
unq02my_table
using index
tablespace my_ts
pctfree 0 nologging
);
Thanks that worked. Where is the SQL Reference, and the Concepts Guide you mentioned?