Unique value column : Unique « Constraints « Oracle PL / SQL






Unique value column

   

SQL>
SQL>
SQL>
SQL> create table t  ( x int unique );

Table created.

SQL> insert into t values ( 1 );

1 row created.

SQL> insert into t values ( 2 );

1 row created.

SQL> update t set x = x+1;

2 rows updated.

SQL>
SQL> drop table t;

Table dropped.

SQL>

   
    
    
  








Related examples in the same category

1.if a column is not explicitely defined as not null, nulls can be inserted multiple times
2.Vialate the unique contraint: try to insert the same value
3.A unique constraint can be extended over multiple columns
4.Add unique containt to a varchar2 type column
5.Create a table with 'unique deferrable initially immediate'
6.Add unique constraints
7.ORA-00001: unique constraint (JAVA2S.JOB_UNIQUE_IN_TEAMID) violated
8.Setting a Unique Constraint