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: Changing column format

RE: Changing column format

From: DENNIS WILLIAMS <DWILLIAMS_at_LIFETOUCH.COM>
Date: Thu, 07 Nov 2002 12:54:17 -0800
Message-ID: <F001.004FE467.20021107125417@fatcity.com>


David - First, export the table the way it is now. Next, what are the end-user implications of this change? Are users querying this? Adding/changing records? Do you have applications that depend on this that must be changed at the same time? The simple answer is to alter table drop primary key, then alter table add primary key (look the exact syntax up in the manual), which will work unless there is a great danger of users adding duplicate records during the time the table doesn't have a primary key. Also are there any other tables that rely on this primary key for referential integrity? Also, depending on the urgency, you may want to create a unique index on username to make sure you don't have any duplicates before you drop your current primary index.

Dennis Williams
DBA, 40%OCP
Lifetouch, Inc.
dwilliams_at_lifetouch.com

-----Original Message-----
Sent: Thursday, November 07, 2002 2:34 PM To: Multiple recipients of list ORACLE-L

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_at_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_at_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).
--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: DENNIS WILLIAMS
  INET: DWILLIAMS_at_LIFETOUCH.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_at_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 - 14:54:17 CST

Original text of this message

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