| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: How Change Column Name?
Hi,
Good try guys, but...
I can create the 2nd table now and get the proper records in, and
even get the 'grants' set by copying the stmt.s out of an export,
but...
What do you do about a primary key???
This is what I used:
I can either create a new table like pii_tbl2 and copy the rows from
the
orig. table to it and then rename pii_tbl2 to pii_tbl, OR
I can rename pii_tbl first to pii_tbl_old and then do this stmt:
create table MFG.pii_tbl
(po_no ,
item_no ,
inspect_date ,
passed_qty ,
rejected_qty ,
initials ,
seq_no ,
CONSTRAINT pii_pk PRIMARY KEY (po_no, item_no, inspect_date)
USING INDEX
TABLESPACE INDEXES
STORAGE ( INITIAL 200K NEXT 50K
MINEXTENTS 1 MAXEXTENTS 100
PCTINCREASE 0 )
MINEXTENTS 1 MAXEXTENTS 100
PCTINCREASE 0 )
Now, the problem is that either way the primary key gets in the way. If I do it the first way then I have to create the new table with a different PRIMARY KEY NAME like pii_pk2, but then I do not know how to rename it afterwards back to what it should be.
Or if I rename first, then I did 'alter table disable primary key'. This drops the primary key, but not totally! It probably physically dropped the index but the name pii_pk is still defined so I cannot use the above sql stmt to create my new table.
What do I do about this?
I do not know of a way to drop constraint pii_pk...
Thanks.
(posted newsgroup reply and sent email)
stantow_at_ibm.net
stanjenn_at_eaglequest.com
Received on Sat Dec 06 1997 - 00:00:00 CST
![]() |
![]() |