Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Create indexes in specific tablespace

Re: Create indexes in specific tablespace

From: malcolm arnold <malcolmarnold_at_gmail.com>
Date: Thu, 10 Nov 2005 10:36:18 +0000
Message-ID: <fc3bda600511100236q4d34796co@mail.gmail.com>


> How can I amend the following to ensure any idexes are created in a
> tablespaced called INDEXES, rather than the default tablespace?

You have to create the table, then add the primary key in separate DDLs:

CREATE TABLE TBLCOLUMNS(
ID INTEGER NOT NULL ,
SQLTYPE INTEGER ,
PSIZE INTEGER ,
COLTYPE VARCHAR2(50) ,
NULABLE VARCHAR2(3) ,
NAME VARCHAR2(20) ,
ID_PARENT INTEGER) alter table TBLCOLUMNS
add PRIMARY KEY (ID)
using index tablespace my_tablespace

alter table TBLCOLUMNS
add FOREIGN KEY (ID_PARENT) REFERENCES TABLTABLE(ID)

Malcolm.

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Nov 10 2005 - 04:38:28 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US