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

Home -> Community -> Usenet -> c.d.o.server -> Re: primary keys and tablespaces

Re: primary keys and tablespaces

From: Valery Yourinsky <vsu_at_bill.mts.ru>
Date: Mon, 29 Jan 2001 10:53:17 +0300
Message-ID: <3A75216D.6E596F44@bill.mts.ru>

csykora_at_my-deja.com wrote:
>
> I am creating a table without any contraints in
> the create table sql. I then want to execute an
> alter table statement to add the primary
> key...well the problem is in dictating what
> tablespace the primary key contraint gets created
> in. I need to do something like this:
>
> create table foo (test char(2), oid number(38));
>
> then execute something like:
>
> alter table foo add primary key(oid) tablespace
> mytablespace;
>
> because the primary key needs to be created in a
> tablespace other than the default for a
> particular schema...but i can't get the alter
> table command to point to the correct
> tablespace...any ideas on the syntax for the
> alter table statement?

   alter table foo

      add primary key(oid) 
      USING INDEX
      tablespace mytablespace;

Valery Yourinsky

-- 
Oracle8 Certified DBA
Moscow, Russia
Received on Mon Jan 29 2001 - 01:53:17 CST

Original text of this message

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