Q
Manage Learn to apply best practices and optimize your operations.

How to resize the columns in a given table

This is rather a very simple question to all--I just got back to Oracle after a long time. The question is how do I resize the columns in a given table? I need the syntax of the command, please.

Thanks,
Padma


Padma,

This is a pretty easy one. The only catch is that you need to "modify" the existing columns. Let's assume that I'm going to resize the NAME column of the EMPLOYEE table to 50 characters. For that, I'll use the following command:

ALTER TABLE employee MODIFY (name VARCHAR2(50));

The only big caveat is that you cannot resize a column smaller than its longest element. For instance, if the NAME column contained a name that was 30 characters in length, then you cannot make the column 25 characters. You will receive an error.

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