Q
Problem solve Get help with specific problems with your technologies, process and projects.

Increasing size of column used as PK

I need to increase the size of a column that is used as a primary key. What is the best way to perform this?

The ALTER TABLE command can modify the column's width. If you are increasing the column's size, then you won't run into problems. Decreasing the column's size can be difficult if any row in the table contains a value in the column larger than the size you are trying to shrink to.

The following command should give you an idea how easy it is to increase the column's size (assume the original size was 20 characters):

ALTER TABLE my_table MODIFY (my_column VARCHAR2(30));
Your column being the Primary Key for the table will not have any bearing on this operation.

For More Information


Dig Deeper on Oracle database design and architecture

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchHRSoftware

Close