David
Try this...
alter table <tablename> drop primary key;
alter table <tablename> add constraint tbl_pkey primary key ( username );
Viral
>From: "Nguyen, David M"
>Reply-To: ORACLE-L@fatcity.com
>To: Multiple recipients of list ORACLE-L
>Subject: Changing column format
>Date: Thu, 07 Nov 2002 12:33:39 -0800
>
>I create a table to store user account information and set "userid" column
>to be primary key. I now want to set "username" to be primary key instead
>of "userid", how do I change it? There are couple hundreds of records in
>table. Please advise.
>
>Thanks,
>David
>--
>Please see the official ORACLE-L FAQ: http://www.orafaq.com
>--
>Author: Nguyen, David M
> INET: david.m.nguyen@xo.com
>
>Fat City Network Services -- 858-538-5051 http://www.fatcity.com
>San Diego, California -- Mailing list and web hosting services
>---------------------------------------------------------------------
>To REMOVE yourself from this mailing list, send an E-Mail message
>to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in
>the message BODY, include a line containing: UNSUB ORACLE-L
>(or the name of mailing list you want to be removed from). You may
>also send the HELP command for other information (like subscribing).
The new
MSN 8: smart spam protection and 2 months FREE*
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Viral Desai
INET: viral303@hotmail.com
Fat City Network Services -- 858-538-5051 http://www.fatcity.com
San Diego, California -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
Received on Thu Nov 07 2002 - 15:04:31 CST