Re: Unique index

From: Ed Bruce <Ed.Bruce_at_ha.hac.com>
Date: 1996/09/23
Message-ID: <3246CA95.4910_at_ha.hac.com>#1/1


Siegfried Hempfer wrote:
>
> Is it possible with the current ORACLE release to define a unique index,
> i.e. to formulate something like CREATE UNIQUE INDEX using ORACLE SQL?
> My documentation from december 92 says no, but maybe thtis was changed
> in the last years?!

Create Table Test_Table (

	A   VARCHAR2(10) PRIMARY KEY  USING INDEX TABLESPACE <tablespace>,
	B   VARCHAR2(10) UNIQUE USING INDEX TABLESPACE <tablespace>,
	C	 VARCHAR2(10));

Or if table Test_Table already exists and you didn't declare B as being unique:

Alter Table Test_Table

        ADD ( UNIQUE (B) USING INDEX TABLESPACE <tablespace> );

You can use all the index options of PCTFREE, STORAGE, etc. If you wish to name the index just name the constraint.

-- 
Ed Bruce                          |   <Ed.Bruce_at_ha.hac.com>
Systems Engineer                  |   
Hughes Aircraft Company           |
Received on Mon Sep 23 1996 - 00:00:00 CEST

Original text of this message