Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: primary keys and tablespaces
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, RussiaReceived on Mon Jan 29 2001 - 01:53:17 CST