Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> creating a primary key
Please note the create table statement. The statment 'using index'
following the primary key statement creates a system generated index.
My question, if I create the table, create an index, then issue an
alter statement, will this accomplish the same thing. I've never seen
a create table statement with this type of index create.
Create Version one;
create table ac_holiday (
user_date date not null, cic char (4) not null,description varchar2 (254),
using index --> new to me tablespace fwclient_data pctfree 10 storage ( initial 20k next 16k pctincrease 50 ))tablespace fwclient_data
This will use the index created.
Create Version two:
CREATE TABLE AC_HOLIDAY (
USER_DATE DATE NOT NULL, CIC CHAR (4) NOT NULL,DESCRIPTION VARCHAR2 (254),
ALTER TABLE AC_HOLIDAY
ADD PRIMARY KEY (USER_DATE, CIC)
USING INDEX
TABLESPACE FWCLIENT_DATA PCTFREE 10
STORAGE(INITIAL 20K NEXT 16K PCTINCREASE 50 ) ;
Are these equivalent?
![]() |
![]() |